The Laravel Option Framework by @haruncpi helps you “manage your Laravel application’s dynamic settings in one place with various supported input types.”
Here’s an example screenshot provided from the project’s readme:
It’s main features include:
- Clean & fresh responsive UI
- Configurable route
- Configurable middleware
- Build-in Option UI
- Various option type support
- Laravel validation rules support
- and more
It works by defining a config/options.php
file, that might look similar to the following example from the README:
1return [ 2 [ 3 "id" => "general", 4 "label" => "General", 5 "icon" => "fa-cubes", 6 "fields" => [ 7 [ 8 "type" => "text", 9 "id" => "site_name",10 "label" => "Site Name",11 "description" => "Enter your site name",12 "icon" => "fa-globe",13 "validation" => 'required|min:10'14 ],15 [16 "type" => "text",17 "id" => "site_slogan",18 "label" => "Site Slogan",19 "description" => "Enter site slogan",20 "validation" => 'required'21 ],22 [23 "type" => "timepicker",24 "id" => "backup_time",25 "label" => "Backup Time",26 "description" => "Set db backup time",27 "validation" => 'required'28 ]29 30 ]31 ],32 [33 "id" => "social",34 "label" => "Social",35 "icon" => "fa-globe",36 "fields" => [ /* ... */ ]37 ]38];
To retrieve an option in your code, you use the getOption()
helper:
1getOption('backup_time');
At the time of writing this package supports the following field types:
- text
- textarea
- switcher
- editor
- colorpicker
- datepicker
- timepicker
- datetimepicker
- dropdown
- autocomplete
- radio
- tag
- multicheck
- icon
You can learn more about this package, get full installation instructions, and view the source code on GitHub at laravel-option-framework.
0 comments:
Post a Comment
Thanks