Support the ongoing development of Laravel.io →
Packages
Last updated 3 months ago.
0

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.

0

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

Last updated 6 years ago.
0

Sign in to participate in this thread!

LoadForge

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 Laravel.io - All rights reserved.