定制 cwsps154/laravel-settings 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

cwsps154/laravel-settings

最新稳定版本:0.0.5

Composer 安装命令:

composer require cwsps154/laravel-settings

包简介

Package that help for creating settings in your Laravel project

README 文档

README

GitHub issues GitHub stars GitHub license

Help to build ui elements with bootstrap using laravel components

Installation

Using Composer

composer require cwsps154/laravel-settings

To publishing the package files

php artisan vendor:publish

You can use tag also

 php artisan vendor:publish --tag=config --tag=components --tag=views --tag=migrations

Usage

Use this model CWSPS154\Settings\Models\Setting in the AppServiceProvider class and add below code in the boot method on you project.

    public function boot()
    {
        if (!app()->runningInConsole()) {
            $settings = cache()->remember(
                'settings',
                3600,
                fn() => Setting::all()->keyBy('key')
            );
            View::share('settings', $settings);
        }
    }

Then you can use the settings with this code in anywhere in the blade pages

$settings['your-key-name']->value ?? $settings['your-key-name']->default

统计信息

  • 总下载量: 19
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: Blade

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-04-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固