- Laravel settings control as like as WordPress options
The Laravel Settings package simplifies the management of application settings in your Laravel project. This README provides installation instructions, usage examples, and additional information.
To get started, install the package using Composer:
composer require anisaronno/laravel-settings
You need to publish migration files, factories, configuration files, and a seeder:
php artisan vendor:publish --tag=settings-migration
Apply the migrations to set up the settings table:
php artisan migrate
Seed the settings table with initial data:
php artisan db:seed --class=LaravelSettingsSeeder::class
The package provides methods for managing settings. Here are the available functions:
You can use the hasSettings
method to check if a key exists in the database:
hasSettings(string $key);
Retrieve a specific setting using its key:
getSettings(string $key);
Fetch all settings fields:
getAllSettings();
Create or update a setting:
setSettings(string $key, string $value);
Update an existing setting:
updateSettings(string $key, string $value);
Update or Create setting:
upsertSettings(string $key, string $value);
Update an existing setting:
deleteSettings(string $key);
Please follow our Contribution Guide if you'd like to contribute to this package.
This package is open-source software licensed under the MIT License.