Doing something in a blade with Form in a new laravel 5.4 project, e.g.
{{ Form::hidden('data-name', $value->name) }}
will throw:
Class 'Form' not found
There are many posts with ways to try to fix this (many different and conflicting answers, some with several files needing to be edited and commands run), but my question is what is the new "correct" way to manipulate the form in laravel 5.x, seeing as it has been dropped (and adding back is non trivial)?
Currently, I have resorted to this option for laravel 5+:
<input type="hidden" name="token" value="{{ app('request')->input('token') }}">
Laravel externalized the management of Forms, Here is the package that implements it the way it used to be (
{{ Form::open() }}
), ({{ Form::close() }}
) etc. All the fields are in the documentation.Run the following command
Next, add your new provider to the providers array of config/app.php:
Finally, add two class aliases to the aliases array of config/app.php: