@ruchit288 Did you register facades too?
'aliases' => [
// ...
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
// ...
],
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello Team, Currently i am working in Laravel5.3, i had tried to installed "laravelcollective/html": "5.3.*" through composer and also add required declaration in config/app.php, but when i run my application it throws an error Class "Form" not found or "HTML" not found ? Please help me on this.
Thanks, Ruchit
@ruchit288 Did you register facades too?
'aliases' => [
// ...
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
// ...
],
Hello, Yea I already declared form and html facade in app.php. But still doesn't work.
Thanks
Try composer dumpautoload to regenerate autoload.
I already execute composer dumpautoload command after declaring laravelCollective in config\app.php
Thanks.
Hello
composer.json
"require": { "php": ">=5.6.4", "laravel/framework": "5.3.", "laravelcollective/html": "5.3." },
config\app.php
'providers' => [ Collective\Html\HtmlServiceProvider::class, ],
'aliases' => [ 'Form' => Collective\Html\FormFacade::class, 'Html' => Collective\Html\HtmlFacade::class, ],
still i face error Class "Form" not found.
Thanks.
Probably not fully updated yet. But I quit using the helpers years ago. Performance hog.
Hello, Same thing work in laravel 5.2 but not work in laravel5.3
Thanks
Quitting the form helpers was the best thing I ever did. Why wait for a third party app to be updated to do basic html stuff?
Hello, So any other options apart form laravelCollective or third party app ?
Thanks
Html.
Look at the form class. All it does is output HTML. So you call a php class and function which while compiling the view, has to look you the class, find the method, do its work just to output HTML.
Look at Form::close(). It outputs '/form. Really need to call a class and method to do that?
Laravelcollective/html is working fine for me on 5.3.
I like it to generate csrf_token and form method spoofing. Also I extend the library with custom methods to generate all CSS classes. So I have more clean views.
composer.json
"require": { "php": ">=5.6.4", "laravel/framework": "5.3.", "laravelcollective/html": "5.3." },
Than update your composer composer update Than work next step
config\app.php
'providers' => [ Collective\Html\HtmlServiceProvider::class, ],
'aliases' => [ 'Form' => Collective\Html\FormFacade::class, 'Html' => Collective\Html\HtmlFacade::class, ],
Thanks.
Your class has to match your facade.
'HTML' => Collective\Html\HtmlFacade::class -----> {{ HTML::link('link', 'Pretty Link - click here!') }}
OR
'Html' => Collective\Html\HtmlFacade::class -----> {{ Html::link('link', 'Pretty Link - click here!') }}
For whatever reason, I had the Laravel configuration cached, so I didn't think about running this:
$ php artisan config:cache
or better yet turn config caching off completely on your machine since you don't need it:
$ php artisan config:clear
composer.json
"require": { "php": ">=5.6.4", "laravel/framework": "5.3.", "laravelcollective/html": "5.3." },
config\app.php
'providers' => [ Collective\Html\HtmlServiceProvider::class, ],
'aliases' => [ 'Form' => Collective\Html\FormFacade::class, 'Html' => Collective\Html\HtmlFacade::class, ],
then try this command composer require laravelcollective/html this will solve error.
composer.json
"require": { "php": ">=5.6.4", "laravel/framework": "5.3.", "laravelcollective/html": "5.3." },
config\app.php
'providers' => [ Collective\Html\HtmlServiceProvider::class, ],
'aliases' => [ 'Form' => Collective\Html\FormFacade::class, 'Html' => Collective\Html\HtmlFacade::class, ],
then try this command composer require laravelcollective/html this will solve error.
Install html via composer as:
composer require laravelcollective/html 5.3
maybe your html structure, i try this ... (add !!)
{!! Form::model($data, array('route' => array('data.update', $data->id), 'method' => 'PUT')) !!}
<div class="form-group">
{!! Form::label('nama_data', 'Nama Data') !!}
{!! Form::text('nama_data', null, array('class' => 'form-control')) !!}
</div>
<div class="form-group">
{!! Form::label('detail_data', 'Detail Data') !!}
{!! Form::email('detail_data', null, array('class' => 'form-control')) !!}
</div>
{!! Form::submit('Edit the Nerd!', array('class' => 'btn btn-primary')) !!}
{!! Form::close() !!}
Please or to participate in this conversation.