All Projects → SMATAR → Laravel Settings

SMATAR / Laravel Settings

Licence: mit
Simple Settings package for a laravel application

Projects that are alternatives of or similar to Laravel Settings

Auth Tests
Always-current tests for Laravel's authentication system. Curated by the community.
Stars: ✭ 230 (+411.11%)
Mutual labels:  laravel, laravel-package, laravel-5-package, laravel5
Larrock Core
Core components for LarrockCMS
Stars: ✭ 46 (+2.22%)
Mutual labels:  laravel, laravel-5-package, laravel5, laravel-admin
Administrator
a fork from Frozennode/Administrator
Stars: ✭ 296 (+557.78%)
Mutual labels:  laravel, laravel-package, laravel-5-package, laravel-admin
Laravel Pdf
A Simple package for easily generating PDF documents from HTML. This package is specially for laravel but you can use this without laravel.
Stars: ✭ 79 (+75.56%)
Mutual labels:  laravel, laravel-package, laravel-5-package, laravel5
Adminlte Laravel
A Laravel 5 package that switchs default Laravel scaffolding/boilerplate to AdminLTE template and Pratt Landing Page with Bootstrap 3.0
Stars: ✭ 1,814 (+3931.11%)
Mutual labels:  laravel, laravel-5-package, laravel-admin, bootstrap
Eye
Eyewitness.io package for Laravel 5 applications
Stars: ✭ 114 (+153.33%)
Mutual labels:  laravel, laravel-package, laravel-5-package, laravel5
Laravel Email Verification
Laravel package to handle user verification using an activation mail
Stars: ✭ 63 (+40%)
Mutual labels:  laravel, laravel-package, laravel-5-package, laravel5
Cms
Multilingual PHP CMS built with Laravel and bootstrap
Stars: ✭ 2,342 (+5104.44%)
Mutual labels:  laravel, laravel5, laravel-admin, bootstrap
Laracms
LaraCMS 是在学习 laravel ( web 开发实战进阶 + 实战构架 API 服务器) 过程中产生的一个业余作品,试图通过简单的方式,快速构建一套基本的企业站同时保留很灵活的扩展能力和优雅的代码方式,当然这些都得益Laravel的优秀设计。同时LaraCMS 也是一个学习Laravel 不错的参考示例。
Stars: ✭ 588 (+1206.67%)
Mutual labels:  laravel, laravel5, laravel-admin, bootstrap
Laravel Form Components
A set of Blade components to rapidly build forms with Tailwind CSS (v1.0 and v2.0) and Bootstrap 4. Supports validation, model binding, default values, translations, Laravel Livewire, includes default vendor styling and fully customizable!
Stars: ✭ 295 (+555.56%)
Mutual labels:  laravel, laravel-package, bootstrap
Jwt Auth Guard
JWT Auth Guard for Laravel and Lumen Frameworks.
Stars: ✭ 319 (+608.89%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Laravel Server Monitor
Server Monitoring Command for Laravel Applications
Stars: ✭ 424 (+842.22%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Laravel Achievements
Achievements for Laravel 5.3+
Stars: ✭ 279 (+520%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Generator
Laravel 5.3+ Scaffold Generator, Support both bootstrap and Semantic UI
Stars: ✭ 327 (+626.67%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Laravel Gamp
📊 Laravel Google Analytics Measurement Protocol Package
Stars: ✭ 271 (+502.22%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Laravel Js Localization
🌐 Convert your Laravel messages and consume them in the front-end!
Stars: ✭ 451 (+902.22%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Framework
The truly Laravel E-commerce Framework
Stars: ✭ 456 (+913.33%)
Mutual labels:  laravel, laravel-package, laravel5
Nova-Dark-Theme
A dark theme for Laravel Nova
Stars: ✭ 72 (+60%)
Mutual labels:  laravel-package, laravel-5-package, laravel5
Telegram
✈️ Telegram Notifications Channel for Laravel
Stars: ✭ 450 (+900%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Fullycms
Fully CMS - Multi Language Content Management System - Laravel
Stars: ✭ 465 (+933.33%)
Mutual labels:  laravel, laravel5, bootstrap

Laravel Settings

Latest Version on Packagist Total Downloads

A Laravel package that provides laravel applications settings module which needed in every application.

Supports laravel >= 5.2

Installation

  1. composer

Add the following to your composer file.

"smatar/laravel-settings": "dev-master"

or run the following command:

composer require smatar/laravel-settings
  1. config/app.php [no need for this step in laravel 5.5 because of packages auto discovery feature]

add your new provider to the providers array:

'providers' => [
    // ...
   	\SMATAR\Settings\App\Providers\SettingServiceProvider::class
    // ...
  ],

and add Setting class to the aliases array:

'aliases' => [
	// ...
	'Settings' => \SMATAR\Settings\App\Facades\Setting::class
    // ...
],
  1. publish

run the following command:

php artisan vendor:publish

config/settings.php and resources/vendor/settings will be added to your laravel project.

  1. migration

you can set table name in config/settings.php

return [
	// ...
	// settings package table name the default is `settings`
    'table' => 'settings'
    // ...
];

the default table name is settings. then run the migration command

php artisan migrate

settings table will be migrated to your Database.

Package Options

after publishing the package new config file added config/settings.php update values as your business requirement:

return [
    //settings route
    'route' => 'settings',

    'middleware' => ['web', 'auth'],

    // hidden records not editable from interface when set to false
    'show_hidden_records' => false,

    //javascript format
    'date_format' => 'mm/dd/yyyy',
    // number of digits after the decimal point
    'number_step' => 0.001,

    // upload path for settings of type file
    'upload_path' => 'uploads/settings',

    // valid mime types for settings of type file
    'mimes' => 'jpg,jpeg,png,txt,csv,pdf',

    'per_page' => 10,

    // settings package table name the default is `settings`
    'table' => 'settings'
];

How to use

the default route for settings is

your-domain/settings

it will shows a list of all settings you have and you can manage your settings from there.

in the code to get a setting value use the facade like that

Validate if the key exist:

\Settings::has('SETTING_KEY');
\Settings::get('SETTING_KEY');
\Settings::get('SETTING_KEY', 'Default value if not exist');

for example:

\Settings::get('SITE_TITLE', 'Laravel Settings');

also you can use astrisk to get group of settings. for example:

\Settings::get('MAIL_*');

will return an array of all settings with keys started with MAIL such as:

[
'MAIL_DRIVER' => 'smtp',
'MAIL_HOST'   => 'mailtrap.io',
'MAIL_PORT'   => '2525',
]

in case of file type a full path will return:

config('settings.upload_path') . '/' . $value;

such as:

uploads/settings/site_logo.png

demo

the demo site:

http://settings.esolution-inc.com/

===================================

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].