Laravel Setting - Easily save, update and get titles, descriptions, and more. it is very easy to use.

Overview

Laravel Setting

Laravel Setting

Easily save, update and get titles, descriptions, and more. it is very easy to use.

This is great for storing and receiving general site information.

Installation

requires PHP 8+ and Laravel 9+

via composer:

$ composer require RanjbarAli/Laravel-Setting

If you do not run Laravel 5.5 (or higher), then add the service provider in config/app.php:

RanjbarAli\LaravelSetting\LaravelSettingServiceProvider::class,

You can publish migration and configuration with:

php artisan vendor:publish --provider="RanjbarAli\LaravelSetting\LaravelSettingServiceProvider"

Migrate:

php artisan migrate

Usage

Initialize

setting()

Get All (array)

setting()->value

Get One (string | array | integer | float | boolean)

setting('key')->value

Get Multiple (array)

setting(['key1', 'key2'])->value

Update (boolean)

setting('key')->set('new value')

Add (boolean)

setting()->add($key, $value, $type)

Type must be one of "string" , "array" , "boolean" , "integer" , "float"

default: "string"

Delete (boolean)

setting('key')->delete()

Check Value (boolean)

setting('key')->is('value')

Check Value with Type (boolean)

setting('key')->is_exactly('value')

Check Exists (boolean)

setting('key')->exists()

Recache

setting()->restart()

Examples

add() : Add and Get One

setting()->add('key', 'value');
setting('key')->value; // Output: 'value'

set()

setting()->add('key', 'old value');
setting('key')->set('new value');
setting('key')->value; // Output: 'new value'

Get Multiple

setting()->add('key1', 'foo');
setting()->add('key2', 'bar');
setting(['key1', 'key2'])->value; // Output: [ 'key1' => 'foo', 'key2' => 'bar' ]

is()

setting()->add('key', '1');
setting('key')->is(1); // Output: true

is_exactly()

setting()->add('key', '1');
setting('key')->is_exactly(1); // Output: false

exists()

setting()->add('key', 'value');
setting('key')->delete();
setting('key')->exists(); // Output: false

in blade:

">
<title> {{ setting('title')->value }} title>
<meta name="description" content=" {{ setting('description')->value }} " />

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

You might also like...
Laravel Boilerplate provides a very flexible and extensible way of building your custom Laravel applications.
Laravel Boilerplate provides a very flexible and extensible way of building your custom Laravel applications.

Laravel Boilerplate Project Laravel Boilerplate provides a very flexible and extensible way of building your custom Laravel applications. Table of Con

Laravel router extension to easily use Laravel's paginator without the query string

🚨 THIS PACKAGE HAS BEEN ABANDONED 🚨 We don't use this package anymore in our own projects and cannot justify the time needed to maintain it anymore.

Podcastwala - Your very own Podcast web app built with Laravel. Manage and listen to your favorite podcasts
Podcastwala - Your very own Podcast web app built with Laravel. Manage and listen to your favorite podcasts

Podcastwala Your very own Podcast web app built with Laravel 5. This web app enables you to manage RSS feeds for your favorite podcasts and listen to

A package to easily make use of Iconic icons in your Laravel Blade views.
A package to easily make use of Iconic icons in your Laravel Blade views.

Blade Iconic A package to easily make use of Iconic icons in your Laravel Blade views. For a full list of available icons see the SVG directory. Iconi

A package to easily make use of Simple Icons in your Laravel Blade views.
A package to easily make use of Simple Icons in your Laravel Blade views.

Blade Simple Icons A package to easily make use of Simple Icons in your Laravel Blade views. For a full list of available icons see the SVG directory.

Zarinpal is a laravel package to easily use zarinpal.com payment services in your applications
Zarinpal is a laravel package to easily use zarinpal.com payment services in your applications

پکیج اتصال به درگاه پرداخت زرین پال zarinpal.com برای اتصال به درگاه پرداخت اینترنتی زرین پال و استفاده از api های آن می توانید از این پکیج استفاده کن

A package to easily make use of SVG icons in your Laravel Blade views.
A package to easily make use of SVG icons in your Laravel Blade views.

Blade Icons A package to easily make use of SVG icons in your Laravel Blade views. Originally "Blade SVG" by Adam Wathan. Turn... !-- camera.svg --

A package to easily make use of Iconsax in your Laravel Blade views.
A package to easily make use of Iconsax in your Laravel Blade views.

Blade Iconsax A package to easily make use of Iconsax in your Laravel Blade views. This package contains 1.000 icons in 6 diferent styles, a total of

Laravel User Activity Log - a package for Laravel 8.x that provides easy to use features to log the activities of the users of your Laravel app
Laravel User Activity Log - a package for Laravel 8.x that provides easy to use features to log the activities of the users of your Laravel app

Laravel User Activity Log - a package for Laravel 8.x that provides easy to use features to log the activities of the users of your Laravel app

Releases(v1.0.0)
Owner
Ali Ranjbar
« Full-stack web developer »
Ali Ranjbar
A Laravel extension for using a laravel application on a multi domain setting

Laravel Multi Domain An extension for using Laravel in a multi domain setting Description This package allows a single Laravel installation to work wi

null 658 Jan 6, 2023
Setting up the a docker + building a simple project on Mac-book using laravel sail

Sailing on mac-book Setting up the a docker + building a simple project on Mac-book with Laravel sail Installing Docker Well, installing docker is the

AmirH.Najafizadeh 3 Jul 31, 2022
⚙️Laravel Nova Resource for a simple key/value typed setting

Laravel Nova Resource for a simple key/value typed setting Administer your Laravel Simple Setting in Nova Pre-requisites This Nova resource package re

elipZis 5 Nov 7, 2022
An open source Laravel Soundboard with Admin Panel CRUD (Create Read Update Delete) built on Laravel, Bootstrap, and Vue.js

Laravel Soundboard An open source Laravel Soundboard with Admin Panel CRUD (Create Read Update Delete) built on Laravel 5.8, Bootstrap 4, Vue.js, Boot

Jeremy Kenedy 24 Oct 28, 2022
An easy way to get vendor and package data from Packagist via API calls

Laravel Packagist Laravel Packagist (LaravelPackagist) is a package for Laravel 5 to interact with the packagist api quickly and easily. Table of cont

Jeremy Kenedy 5 Jul 18, 2022
Allow your model to record the creation, update and deletion of user fingerprints in laravel packages

This laravel package will allow your models to record the the created, updated and deleted by User FingerPrints

Managemize 4 Mar 11, 2022
Update multiple Laravel Model records, each with it's own set of values, sending a single query to your database!

Laravel Mass Update Update multiple Laravel Model records, each with its own set of values, sending a single query to your database! Installation You

Jorge González 88 Dec 31, 2022
A laravel package to handle sanitize process of model data to create/update model records.

Laravel Model UUID A simple package to sanitize model data to create/update table records. Installation Require the package using composer: composer r

null 66 Sep 19, 2022
Perform Bulk/Batch Update/Insert/Delete with laravel.

Bulk Query Perform Bulk/Batch Update/Insert/Delete with laravel. Problem I tried to make bulk update with laravel but i found that Laravel doesn't sup

Mohamed Samir 9 Dec 14, 2021
Laravel Seo package for Content writer/admin/web master who do not know programming but want to edit/update SEO tags from dashboard

Laravel Seo Tools Laravel is becoming more and more popular and lots of web application are developing. In most of the web application there need some

Tuhin Bepari 130 Dec 23, 2022