PHPackages                             sajadsdi/laravel-setting-pro - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. sajadsdi/laravel-setting-pro

ActiveLaravel-package[Utility &amp; Helpers](/categories/utility)

sajadsdi/laravel-setting-pro
============================

Easy settings management for laravel framework

2.0.2(2y ago)1315.9k↓50%4MITPHPPHP ^8.1

Since Dec 9Pushed 2y ago1 watchersCompare

[ Source](https://github.com/sajadsdi/laravel-setting-pro)[ Packagist](https://packagist.org/packages/sajadsdi/laravel-setting-pro)[ RSS](/packages/sajadsdi-laravel-setting-pro/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (3)Versions (8)Used By (0)

[![Laravel Setting Pro](https://camo.githubusercontent.com/f821ba72219b234c47212fec95724acbd6ac19e3381128dae56a98d3f799776b/68747470733a2f2f73616a61647364692e6769746875622e696f2f696d616765732f6c61726176656c2d73657474696e672d70726f2e6a7067)](https://camo.githubusercontent.com/f821ba72219b234c47212fec95724acbd6ac19e3381128dae56a98d3f799776b/68747470733a2f2f73616a61647364692e6769746875622e696f2f696d616765732f6c61726176656c2d73657474696e672d70726f2e6a7067)

Laravel Setting Pro
===================

[](#laravel-setting-pro)

Effortless Management of Laravel Application Settings.

Description
-----------

[](#description)

A Laravel package that provides a simple and effective way to handle application settings with support for persistent storage using both file-based and database drivers.

Features
--------

[](#features)

The Laravel Setting Pro package simplifies application settings management in Laravel and provides these key features:

- **Flexible Storage**: Choose between file-based or database storage to suit your application's needs.
- **Flexible Database**: Choose between `mysql` or `mongodb` or create own db connection for settings.
- **Caching**: Improve performance with automatic caching of settings. You can choose between `file` or `redis` or create own cache driver.
- **Queue Support**: Handle setting updates and deletes in the background, ensuring smooth user experiences.
- **Event Triggers**: Respond to setting changes in real-time by leveraging Laravel events.
- **Global Helper Function &amp; Facade**: Access and manipulate settings anywhere in your laravel app with a simple `setting` function or `Setting` facade (even in the config files).
- **Artisan Commands for Ease of Use**: Publish configuration and migrations effortlessly with the `setting:publish`artisan command; complete installations, migrations, and initial tests using the `setting:install` command.
- **Easy get &amp; set and delete settings with dot notation**: `get` &amp; `set` &amp; `delete` and `has` operations on nested settings keys.
- **Easy import settings** : Import settings from a driver to default store driver.
- **Auto create setting** : you can use default value for get operation or set operation on any new setting name.

This package is designed for developers looking for an efficient and intuitive way to handle application settings. It offers the necessary tools while keeping the process simple and maintainable.

Requirements
------------

[](#requirements)

- PHP ^8.1
- Laravel ^9.0|^10.0

Installation
------------

[](#installation)

Use Composer to install the package:

```
composer require sajadsdi/laravel-setting-pro
```

Setup
-----

[](#setup)

After the package installation, use the provided Artisan commands to publish configuration and migration files, and complete the installation process:

First, publish the configuration and migration files using:

```
php artisan setting:publish
```

This will publish `_setting.php` to your `config` folder and migration file.

Then, use the installation command to perform migrations and any necessary setup operations:

```
php artisan setting:install
```

These commands will set up your settings table in the database and ensure that the package is ready to use.

Usage
-----

[](#usage)

Two ways to use Laravel Setting Pro:

1. Using the `setting` function:

```
// Get a setting value
$value = setting('my_setting')->get('key', 'default value');
//or
$value = setting('my_setting','key', 'default value');
//or
$value = setting()->select('my_setting')->get('key', 'default value');

// Set a setting value
setting('my_setting')->set(['key' => 'value']);
//or
setting()->select('my_setting')->set(['key' => 'value']);

//delete a key from setting
setting('my_setting')->delete('key');
//or
setting()->select('my_setting')->delete('key');
```

2. Using the `Setting` facade:

```
