Download the PHP package soandso/laravel-options without Composer
On this page you can find all versions of the php package soandso/laravel-options. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download soandso/laravel-options
More information about soandso/laravel-options
Files in soandso/laravel-options
Package laravel-options
Short Description Laravel service for global storing key-value structure data
License MIT
Informations about the package laravel-options
Laravel options
Laravel service for global storing in database key-value structure data
Requirements
This library only requires PHP >= 8.0
Setup
Add the library to your composer.json file in your project:
Use composer to install the library:
You can also use composer on the command line to require and install Grouping:
You should publish the migration with
Run to migrate the table.
Usage
Facade
Set parameter value:
The parameter key must be unique to the Option entity Formats available for the parameter value - string, array
The method returns in case of successful setting of the parameter value or in case of an error
Get parameter value:
If there is no parameter for the specified key, the method will return
Check if the parameter with the given key exists
Returns or depending on the result
Delete a parameter by its key
Returns if deletion was successful, if deletion failed.
Helper function
With helper you can set options
helper will return the value of the option by its key `
Helper function checks if the parameter with the given key exists
Function deletes a parameter by its key
Console
The command to delete parameters is available in the console.
This command will delete all data. You can restrict deletion by the date of creation or last update of the parameter
Date must be in format. In this case, all parameters that are older than the specified date will be deleted.
License
Laravel option is licensed under the MIT License (https://github.com/appstract/laravel-options/blob/HEAD/LICENSE.md).