graciano/blade-helpers
Blade Helpers
Helpers for laravel blade template inputs. Tested in laravel 5.2, 5.3 and 5.4
Usage
<input type="text" name='name' value="{{ input_value($obj, 'name') }}" />
<!-- this will call $obj->{name} for the value, if none is found (or the obj is null), old('name') will be displayed -->
Or, if you have a checkbox:
<input type="checlbox" name='accept' {{ input_checked($obj, 'accepted') }} />
<!-- this will print checked if the obj->accepted (or the old input) is anything but false/null -->
Install
First, require the project with composer: $ composer require graciano/blade-helpers
Add the file in your composer.json files section, like this:
"autoload": {
"files":[
"vendor/graciano/blade-helpers/src/helpers.php"
],
}
Then, composer dumpautoload
License
This project is open-sourced software licensed under the MIT license
Related Packages
anourvalar/laravel-form
Laravel blade components for HTML form elements (input / select / textarea)
8,938
0
philo/laravel-blade
Use the simple and yet powerful Laravel Blade templating engine as a standalone...
688,680
355
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v1.1.0 | >=5.5.9 | ~5.2 | MIT | |
| v1.0.0 | >=5.5.9 | ~5.2 | MIT | |
| v0.2.0 | >=5.5.9 | ~5.1 | MIT | |
| v0.1.2 | >=5.5.9 | ~5.1 | MIT | |
| v0.1.1 | >=5.5.9 | ~5.1 | MIT |