mabrouk/project-setting is a Laravel api package for dealing with project settings.
Configurations according to project needs
After installation and modifing configuration:
- run command
php artisan setting:install
. - include predefined routes which control project setting types, groups, sections and settings display names in your api documentation to make it available for implementation from frontend developer side. or guide frontend developer to this documentation Models Api Resources to expect in requests response section
You can install the package using composer.
composer require mabrouk/project-setting
- Now you need to run the following
command
in order to migrate package tables and publishproject_settings.php
config file to config directory
php artisan setting:install
Config file have several configuration options and already have enough comments to describe every key meaning and how to use.
You may access it under config/project_settings.php
After modifying
project_settings.php
config file don't forget to run below command:
php artisan config:cache
We have 4 basic models to deal with:
ProjectSettingType
ProjectSettingGroup
ProjectSettingSection
ProjectSetting
Let's run the route:list
command and discover our package predefined routes
php artisan route:list
// to be continue
Actually one more thing to know is that this package depend on mabrouk/translatable package in order to handle translation dynamically for any chosen language.
You will need to pass additional input "locale" in update requests of mentioned models and need to create groups and sections with your application default language.
To get response with desired language you need to pass additional header to your requests "X-locale" with one of the available locales in your application
Both "locale" and "X-locale" accept values like ['en', 'ar', 'fr', ...] etc depending on languages you support in your project.
mabrouk/project-setting package is open-sourced software licensed under the MIT license.