Laravel Option Framework

Packages

February 26th, 2020

Laravel Option Framework

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:

return [
[
"id" => "general",
"label" => "General",
"icon" => "fa-cubes",
"fields" => [
[
"type" => "text",
"id" => "site_name",
"label" => "Site Name",
"description" => "Enter your site name",
"icon" => "fa-globe",
"validation" => 'required|min:10'
],
[
"type" => "text",
"id" => "site_slogan",
"label" => "Site Slogan",
"description" => "Enter site slogan",
"validation" => 'required'
],
[
"type" => "timepicker",
"id" => "backup_time",
"label" => "Backup Time",
"description" => "Set db backup time",
"validation" => 'required'
]
 
]
],
[
"id" => "social",
"label" => "Social",
"icon" => "fa-globe",
"fields" => [ /* ... */ ]
]
];

To retrieve an option in your code, you use the getOption() helper:

getOption('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.

Filed in:

Paul Redmond

Full stack web developer. Author of Lumen Programming Guide and Docker for PHP Developers.