My Blog Posts

Laravel Option Framework

Laravel Option Framework


The Laravel Option Framework, presented by Haruncpi, helps you manage in one place with a variety of input types that support the dynamic settings of your Laravel application.


The main features are:

  • A simple user interface
  • Adjustable route
  • Configurable middleware
  • Interchangeable interface
  • Laravel verification support

config/options.php works by defining a file that looks like the following example:

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 import an option in your code getOption():

getOption('backup_time');

The following field types are supported during writing this package:

  • text
  • Textarea
  • Switcher
  • editor
  • Colorpicker
  • datepicker
  • timepicker
  • Datetimepicker
  • Dropdown
  • Autocomplete
  • radio
  • Tag
  • multicheck
  • icon

You can learn more about this package, get all setup instructions, and view the source code on GitHub from the laravel-option-framework.



Share this article


Comments (0)

Comment