I've tried to use the Laravelcollective/html
on laravel 5.5 by loading the v5.4 in my composer.json
file but that didn't work. This is the code in the composer.json
file:
"laravelcollective/html":"^5.4.0",
and loading it into my app configuration file app.php
: inside the providers array
Collective\Html\HtmlServiceProvider::class,
But after i used the blade code to create the form it didn't work, here's the blade code.
{!! Form::open(['route' => 'posts.store']) !!}
{{Form::label('title','Title:')}}
{{Form::text('title', null, array('class' => 'form-control') )}}
{!! Form::close() !!}
Install laravelcollective/html
via Terminal/CMD:
composer require laravelcollective/html:^5.5.0
In app/config/app.php
, add the following:
'providers' => [
// ...,
Collective\Html\HtmlServiceProvider::class,
// ...
],
'aliases' => [
// ...,
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
// ...
],
And in your blade file:
{!! Form::open(['route' => 'posts.store']) !!}
{!! Form::label('title', 'Title:') !!}
{!! Form::text('title', null, array('class' => 'form-control')) !!}
{!! Form::close() !!}
You can use this command
composer require --update-with-all-dependencies "laravelcollective/html 5.6.*"... since you are using laravel 5.5 the command to use will be
composer require "laravelcollective/html 5.5.*"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With