Laravel Idea for PhpStorm - Full-featured IDE for productive artisans!

Easy management of your application settings with Setting Pro

Published on by

Easy management of your application settings with Setting Pro image

Laravel Setting Pro is a package that provides a simple and effective way to handle your application settings with support for persistent storage using either file-based or database drivers.

Setting Pro Usage

You can use the package two ways:

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');

Using the Setting facade:

<?php
use Sajadsdi\LaravelSettingPro\Support\Setting;
 
// Get a setting value
$value = Setting::select('my_setting')->get('key', 'default value');
//or
$value = Setting::my_setting()->get('key', 'default value');
//or
$value = Setting::my_setting('key', 'default value');
 
// Set a setting value
Setting::select('my_setting')->set('key', 'value');
//or
Setting::my_setting()->set('key', 'value');
 
//delete key from setting
Setting::select('my_setting')->delete('key');
//or
Setting::my_setting()->delete('key');
 
//checking exists by has method
if(Setting::select('my_setting')->has('key')){
echo "key exists!";
}else{
echo "key not exists!";
}

Setting Pro Features Include

  • 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 & 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 & set and delete settings with dot notation: get & set & 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.

Read more

Visit the GitHub repo for installation instructions and for more information on how to use the package.

Eric L. Barnes photo

Eric is the creator of Laravel News and has been covering Laravel since 2012.

Filed in:
Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.

image
Battle Ready Laravel

The ultimate guide to auditing, testing, fixing and improving your Laravel applications so you can build better apps faster and with more confidence.

Visit Battle Ready Laravel
Curotec logo

Curotec

World class Laravel experts with GenAI dev skills. LATAM-based, embedded engineers that ship fast, communicate clearly, and elevate your product. No bloat, no BS.

Curotec
Bacancy logo

Bacancy

Supercharge your project with a seasoned Laravel developer with 4-6 years of experience for just $2500/month. Get 160 hours of dedicated expertise & a risk-free 15-day trial. Schedule a call now!

Bacancy
Laravel Forge logo

Laravel Forge

Easily create and manage your servers and deploy your Laravel applications in seconds.

Laravel Forge
Tinkerwell logo

Tinkerwell

The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.

Tinkerwell
Cut PHP Code Review Time & Bugs into Half with CodeRabbit logo

Cut PHP Code Review Time & Bugs into Half with CodeRabbit

CodeRabbit is an AI-powered code review tool that specializes in PHP and Laravel, running PHPStan and offering automated PR analysis, security checks, and custom review features while remaining free for open-source projects.

Cut PHP Code Review Time & Bugs into Half with CodeRabbit
Join the Mastering Laravel community logo

Join the Mastering Laravel community

Connect with experienced developers in a friendly, noise-free environment. Get insights, share ideas, and find support for your coding challenges. Join us today and elevate your Laravel skills!

Join the Mastering Laravel community
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift
Lucky Media logo

Lucky Media

Get Lucky Now - the ideal choice for Laravel Development, with over a decade of experience!

Lucky Media
Lunar: Laravel E-Commerce logo

Lunar: Laravel E-Commerce

E-Commerce for Laravel. An open-source package that brings the power of modern headless e-commerce functionality to Laravel.

Lunar: Laravel E-Commerce
LaraJobs logo

LaraJobs

The official Laravel job board

LaraJobs
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit

The latest

View all →
Chargebee Starter Kit for Billing in Laravel image

Chargebee Starter Kit for Billing in Laravel

Read article
Streamline Pipeline Cleanup with Laravel's finally Method image

Streamline Pipeline Cleanup with Laravel's finally Method

Read article
Validate Controller Requests with the Laravel Data Package image

Validate Controller Requests with the Laravel Data Package

Read article
Transform JSON into Typed Collections with Laravel's AsCollection::of() image

Transform JSON into Typed Collections with Laravel's AsCollection::of()

Read article
Auto-translate Application Strings with Laratext image

Auto-translate Application Strings with Laratext

Read article