Download the PHP package laraveleg/options without Composer
On this page you can find all versions of the php package laraveleg/options. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package options
laravel options
You can create options, reuse them and rely on them at a later time. Inspired by the WordPress system and built on the Laravel
framework.
Install for laravel
Install for lumen
Register service provider
Go to bootstrap/app.php
file and add the following line
Migrate options table
Usage
You can manage options in a simple way by helpers.
Cache Mode
add_option
You can add an option through the following line :-
$key
: The option ID that you will use to fetch its value.
$value
: Put the value of any type of data.
$expiration
: Expiration date. This can be unused and saved all the time. Ex: add_option($key, $value)
.
get_option
Fetching value for a specific option :-
$key
: The option ID.
$default
: You can specify a default value if the option is not found.
has_option
Make sure the option is there :-
$key
: The option ID.
remove_option
You can delete any option :-
$key
: The option ID.
Eloquent Mode
You can put the settings to a specific element in a specific model.
Vendor publish
Migrate options table
Set config
Go to laraveloptions.php
file in configs directory
Use for model
Add the trait in your specific model.
add_option
You can add an option through the following line :-
$key
: The option ID that you will use to fetch its value.
$value
: Put the value of any type of data.
$expiration
: Expiration date. This can be unused and saved all the time. Ex: add_option($key, $value)
.
get_option
Fetching value for a specific option :-
$key
: The option ID.
$default
: You can specify a default value if the option is not found.
has_option
Make sure the option is there :-
$key
: The option ID.
remove_option
You can delete any option :-
$key
: The option ID.
You an use this
Trait
in any model on your app.
Command-lines
Remove all options
Remove all options on eloquent mode
Testing
Run the tests with:
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
License
The MIT License (MIT). Please see License File for more information.