Download the PHP package larapp/laravel-options without Composer
On this page you can find all versions of the php package larapp/laravel-options. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download larapp/laravel-options
More information about larapp/laravel-options
Files in larapp/laravel-options
Package laravel-options
Short Description User options for laravel application
License MIT
Informations about the package laravel-options
Laravel user options
This package simplifies working with user options of your laravel application. The options are saved in two places:
- default options (directives) are in config / options.php
- user options (directives) are stored in option table
When set, the default options will be overwritten by the corresponding user options. This override can be disabled by default, or it can be disabled in developer mode.
All values are cached and the number of database queries is minimized. When you save a new value (or delete an existing value), the cache is regenerated. The data is always fresh.
Installation
Install the package via composer:
Run migrations
Run the following command to run migrations.
Publish config
Run the following command to publish configs.
Create new default directives
The default directives are stored in config / options.php
Create users directive
The user options are accessed like any other object. Example to create:
Use options
You can determine the value of a directive using the standard config function:
Refresh cache
Command
Code
Casting values
Everything is stored in the database as text. When the values are read, the type is automatically cast. You can control this cast in config / options-package.php
Package setting
See config/options-package.php for setting package behavior.
After its change you MUST refresh the cache!
Versions
- 0.1.0 First version
- 0.2.0 Add cache driver to package config