LaravelPackages.net
Acme Inc.
Toggle sidebar
laravel-daddy/swift-settings

easy way to manage and cache settings in laravel app

7
0
4.0
About laravel-daddy/swift-settings

laravel-daddy/swift-settings is a Laravel package for easy way to manage and cache settings in laravel app. It currently has 0 GitHub stars and 7 downloads on Packagist (latest version 4.0). Install it with composer require laravel-daddy/swift-settings. Discover more Laravel packages by laravel-daddy or browse all Laravel packages to compare alternatives.

Last updated

Swift Settings Package

Crafted with ♥️ by Laravel Daddy

Installation

To install the package, run the following command:

composer require laravel-daddy/swift-settings

Upon installation, the package will automatically publish the necessary migrations and register the SwiftSettingsServiceProvider.

Usage

All settings are automatically cached to enhance the performance of your application. This ensures that accessing settings is efficient and optimized.

You can manage settings using either the facade or the helper method.

Using the Facade

use LaravelDaddy\SwiftSettings\Facade\SwiftSettingsFacade;

// Retrieve a setting by its key, with a default value if the key doesn't exist
SwiftSettingsFacade::getSetting('key', 'default_value');

// Set a new value for a specific key
SwiftSettingsFacade::setSetting('key', 'value');

Using the Helper Method

// Retrieve a setting by its key, with a default value if the key doesn't exist
swift_settings()->getSetting('key', 'default_value');

// Set a new value for a specific key
swift_settings()->setSetting('key', 'value');

Both approaches allow you to retrieve or update settings efficiently, with all keys being cached for improved performance.

Star History Chart