I would like to know how to register a dependency when creating laravel package.
In my package composer.json I have :
{ "name": "facilinfo/gallery", "description": "Photo galleries management package for laravel", "type": "library", "license": "MIT", "keywords": ["laravel"], "authors": [ { "name": "facilinfo", "email": "[email protected]" } ], "minimum-stability": "stable", "require": { "laravelcollective/html": "5.2.*", "intervention/image": "dev-master" }, "autoload": { "psr-4": { "Facilinfo\\Gallery\\": "src/" } } } And when I do
$form = new Form(); I have a Class not found error.
How can I solve it?
$form = new \Form();code$this->app->register(\Collective\Html\HtmlServiceProvider::class); $loader = \Illuminate\Foundation\AliasLoader::getInstance(); $loader->alias('Form', '\Collective\Html\FormFacade');codeand to add "laravelcollective/html": " 5.2.*" in the laravel installation where I'm developping my package and install in. It works now.