tahirrasheed208/laravel-settings

Store your application settings

2.0.0 2023-02-19 05:41 UTC

This package is auto-updated.

Last update: 2024-04-19 08:14:55 UTC


README

Latest Version on Packagist GitHub Workflow Status Total Downloads

This package allows you to save settings in DB & Cache. You can use helper function to get settings value anywhere within laravel.

  • Database support
  • Helper function
  • Cache support

Getting Started

1. Install

Run the following command:

composer require tahirrasheed208/laravel-settings

2. Publish

Publish config file.

php artisan vendor:publish --provider="TahirRasheed\LaravelSettings\SettingsServiceProvider" --tag=config

3. Database

Create table in database.

php artisan migrate

4. Configure

You can change the options of your app from config/settings.php file

Usage

Helper

setting()->get('foo');
setting()->get('foo', 'default');
setting()->put('foo', 'bar');
setting()->delete('foo');

Facade

Setting::get('foo');
Setting::get('foo', 'default');
Setting::put('foo', 'bar');
Setting::delete('foo');

Testing

./vendor/bin/phpunit

Changelog

Please see Releases for more information what has changed recently.

Contributing

Pull requests are more than welcome. You must follow the PSR coding standards.

Security

If you discover any security related issues, please email tahirrasheedhtr@gmail.com instead of using the issue tracker.

License

The MIT License (MIT). Please see LICENSE for more information.