For anybody interested inside your package service provider / register method include the lines:
$this->app->register('Collective\Html\HtmlServiceProvider');
$loader = \Illuminate\Foundation\AliasLoader::getInstance();
$loader->alias('HTML', 'Collective\Html\HtmlFacade');
Using the "collective" library not the illuminate library.
jacksoncharles said:
For anybody interested inside your package service provider / register method include the lines:
$this->app->register('Collective\Html\HtmlServiceProvider'); $loader = \Illuminate\Foundation\AliasLoader::getInstance(); $loader->alias('HTML', 'Collective\Html\HtmlFacade');
Using the "collective" library not the illuminate library.
@jacksoncharles, How you should be exactly my ServiceProvider to run the Collective\Html? I'm trying this:
public function register()
{
$this->app->register('Collective\Html\HtmlServiceProvider');
$loader = \Illuminate\Foundation\AliasLoader::getInstance();
$loader->alias('Form', 'Collective\Html\FormFacade');
$loader->alias('HTML', 'Collective\Html\HtmlFacade');
$this->app->bind('mypackage', function ($app) {
return new MyPackage;
});
}
but I still getting Class 'Html' not found
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community