vluzrmos/collective-html
Forms & HTML
Official documentation for Forms & Html for The Laravel/Lumen Framework can be found at the LaravelCollective website.
Instalation on Lumen
composer require vluzrmos/collective-html
Configuration
On your bootstrap/app.php:
$app->register('Collective\Html\HtmlServiceProvider');
class_alias('Collective\Html\HtmlFacade', 'Html');
class_alias('Collective\Html\FormFacade', 'Form');
And remember to enable de facades, just uncomment that line:
$app->withFacades()
If you want to automatically inject the $html and $form variables on all your Blade's View:
$app->register('Collective\Html\InjectVarsServiceProvider');
And now you will not need the facades anymore, just that:
{!! $form->open() !!}
//...
{!! $html->asset() !!}
Known Issues
Lumen UrlGenerator doesn't support route('route.name', $id), because that you have to use an associative array:
{!! Form::open(['route' => ['route.name', ['id' => $id ] ]]) !!}
Lumen UrlGenerator do not generate correctly urls on console commands or non-browser requests, to fix that I suggest you to install my other package:
composer require vluzrmos/lumen-url-host
And add lumenUrlHost('your-disired.domain:port'); at the top of your bootstrap/app.php file.
Link: vluzrmos/lumen-url-host.
Replacing LaravelCollective/Html
If your project require some package that requires laravelcollective/html, you can edit your composer.json to:
for Lumen 5.1:
"vluzrmos/collective-html": "1.0.9 as 5.1",
"package-vendor/package-required-name":"package-version" //that requires laravelcollective/html 5.1
for Lumen 5.0:
"vluzrmos/collective-html": "1.0.9 as 5.0",
"package-vendor/package-required-name":"package-version" //that requires laravelcollective/html 5.0
Note: use version 1.0.9 or the latest vluzrmos/collective-html version.
Credits
That package is just a free modification of LaravelCollective/Html to work with Lumen Framework.
Related Packages
Handle form model binding, old input binding and validation error messages in a...
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v1.0.13 | >=5.4.0 | ~5.0 | MIT | |
| v1.0.12 | >=5.5.9 | ~5.0 | MIT | |
| v1.0.11 | >=5.5.9 | ~5.0 | MIT | |
| v1.0.10 | >=5.5.9 | ~5.0 | MIT | |
| v1.0.9 | >=5.5.9 | ~5.0 | MIT | |
| v1.0.8 | >=5.5.9 | ~5.0 | MIT | |
| v1.0.7 | >=5.5.9 | ~5.0 | MIT | |
| v1.0.6 | >=5.5.9 | 5.0.*| | MIT | |
| v1.0.5 | >=5.5.9 | 5.0.*| | MIT | |
| v1.0.4 | >=5.5.9 | 5.0| | MIT | |
| v1.0.3 | >=5.5.9 | 5.0| | MIT | |
| v1.0.2 | >=5.5.9 | 5.0| | MIT | |
| v1.0.1 | >=5.5.9 | 5.0| | MIT | |
| v1.0.0 | >=5.5.9 | 5.0| | MIT |