承接 junaidnasir/globalsettings 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

junaidnasir/globalsettings

Composer 安装命令:

composer require junaidnasir/globalsettings

包简介

Laravel global settings, set/get global settings for your app

README 文档

README

Global Settings package for laravel, to quickly retrieve and store settings data in DB.

Installation

Begin by installing the package through Composer. Run the following command in your terminal:

composer require junaidnasir/globalsettings

add the package service provider in the providers array in config/app.php:

Junaidnasir\GlobalSettings\GlobalSettingsServiceProvider::class

you may add the facade access in the aliases array:

'GlobalSettings'  => Junaidnasir\GlobalSettings\Facades\GlobalSettings::class

publish the migration and config file:

php artisan vendor:publish"

migrate to create global_settings table

php artisan migrate

Usage

You can use facade accessor to retrieve the package controller. Examples:

GlobalSettings::set('allowUserSignUp',0);
GlobalSettings::set('userPostLimit',10);

// Get registration
if( GlobalSettings::get('allowUserSignUp'))
{
    //show form
}

// Post controller
if (count($user->post) >= GlobalSettings::get('userPostLimit'))
{
    // Can not create post limit reached
}

API

/* Set or update setting
*  $isActive is additional parameter 
*  to quickly disable a setting without
*  having to delete the setting
*/
set($Setting, $Value, $isActive = true);

/* Get Settings
*  return value of setting
*  or default value provided
*/
get($Setting, $default = null);

/* check if setting exists 
* return true if setting exists
* false otherwise
*/
has($Setting);

// Other Methods
update($setting, $value, $isActive);

isActive($setting);
activate($setting);
deactivate($setting);
delete($setting);

统计信息

  • 总下载量: 1.52k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-04-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固