定制 anisaronno/laravel-settings 二次开发

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

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

anisaronno/laravel-settings

最新稳定版本:1.2.0

Composer 安装命令:

composer require anisaronno/laravel-settings

包简介

A Laravel package for managing application settings, similar to WordPress options.

README 文档

README

  • Laravel settings control as like as WordPress options

Table of Contents

Introduction

The Laravel Settings package simplifies the management of application settings in your Laravel project. This README provides installation instructions, usage examples, and additional information.

Installation

To get started, install the package using Composer:

composer require anisaronno/laravel-settings

Publish Migration, Factory, Config, and Seeder

You need to publish migration files, factories, configuration files, and a seeder:

php artisan vendor:publish --tag=settings-migration

Run Migration

Apply the migrations to set up the settings table:

php artisan migrate

Run Seeder

Seed the settings table with initial data:

php artisan db:seed --class=LaravelSettingsSeeder::class

Usage

The package provides methods for managing settings. Here are the available functions:

Check if a Key Exists in Database

You can use the hasSettings method to check if a key exists in the database:

hasSettings(string $key);

Get Settings Field

Retrieve a specific setting using its key:

getSettings(string $key);

Get All Settings Fields

Fetch all settings fields:

getAllSettings();

Set Settings

Create or update a setting:

setSettings(string $key, string $value);

Update Settings

Update an existing setting:

updateSettings(string $key, string $value);

Update or Create Settings

Update or Create setting:

upsertSettings(string $key, string $value);

Delete Settings

Update an existing setting:

deleteSettings(string $key);

Contribution Guide

Please follow our Contribution Guide if you'd like to contribute to this package.

License

This package is open-source software licensed under the MIT License.

统计信息

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

GitHub 信息

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

其他信息

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