Download the PHP package prepr/laravel-settings without Composer
On this page you can find all versions of the php package prepr/laravel-settings. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-settings
Laravel Settings
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.
"prepr/laravel-settings": "3.0"
or run the following command:
2) 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:
and add Setting class to the aliases array:
3) publish
run the following command:
config/settings.php
and resources/vendor/settings
will be added to your laravel project.
4) migration
you can set table name in config/settings.php
the default table name is settings
. then run the migration command
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:
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:
for example:
also you can use astrisk to get group of settings. for example:
will return an array of all settings with keys started with MAIL such as:
in case of file type a full path will return:
such as:
uploads/settings/site_logo.png
===================================