定制 mt-settings/laravel-settings 二次开发

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

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

mt-settings/laravel-settings

Composer 安装命令:

composer require mt-settings/laravel-settings

包简介

A simple settings management system for Laravel applications with RTL support

README 文档

README

A simple and elegant settings management system for Laravel applications.

Laravel Settings License Version

✨ Features

  • 🚀 Easy to install and use
  • 🔒 Secure and optimized for performance
  • 💾 Cached settings for better performance
  • 🧩 Organized settings by categories
  • 🔄 Simple API to get/set settings in your application

📦 Installation

You can install the package via composer:

composer require mt-settings/laravel-settings

Manual Installation

  1. Publish the configuration:
php artisan vendor:publish --tag=laravel-settings-config
  1. Publish the migrations:
php artisan vendor:publish --tag=laravel-settings-migrations
  1. Run the migrations:
php artisan migrate

📝 Usage

In Controllers

use MtSettings\LaravelSettings\Facades\Settings;

// Get a setting with a default value
$siteName = Settings::get('site_name', 'Default Site Name');

// Set a setting
Settings::set('maintenance_mode', true);

// Check if a setting exists
if (Settings::has('meta_title')) {
    // Do something
}

// Get all settings
$allSettings = Settings::getAll();

// Clear settings cache
Settings::clearCache();

In Blade Templates

{{-- Get a setting with a default value --}}
<title>{{ Settings::get('site_name', config('app.name')) }}</title>

{{-- Check if a setting exists and use it --}}
@if(Settings::has('meta_description'))
    <meta name="description" content="{{ Settings::get('meta_description') }}">
@endif

{{-- Use a setting with a condition --}}
@if(Settings::get('maintenance_mode', false))
    <div class="alert alert-warning">
        The site is currently in maintenance mode
    </div>
@endif

Admin Panel

The package includes a complete admin panel for managing settings. By default, it's accessible at:

/admin/settings

You can customize the route prefix and middleware in the configuration file.

⚙️ Configuration

You can customize the package behavior by modifying the published configuration file:

// config/settings.php

return [
    'route_prefix' => 'admin',
    'middleware' => ['web', 'auth'],
    // ...
];

📋 Available Settings

The package comes with predefined settings categories:

Category Settings
General site_name, items_per_page, maintenance_mode
SEO meta_title, meta_description, meta_keywords
Contact contact_email, phone_number, address
Social Media facebook_url, twitter_url, instagram_url, linkedin_url
Advanced cache_enabled, cache_expiration, google_analytics_id, custom_header_scripts

General

  • site_name: Your site name
  • items_per_page: Default number of items per page
  • maintenance_mode: Enable/disable maintenance mode

SEO

  • meta_title: Default meta title
  • meta_description: Default meta description
  • meta_keywords: Default meta keywords

Contact

  • contact_email: Contact email address
  • phone_number: Contact phone number
  • address: Physical address

Social Media

  • facebook_url: Facebook page URL
  • twitter_url: Twitter profile URL
  • instagram_url: Instagram profile URL
  • linkedin_url: LinkedIn profile URL

Advanced

  • cache_enabled: Enable/disable settings cache
  • cache_expiration: Cache expiration time in seconds
  • google_analytics_id: Google Analytics tracking ID
  • custom_header_scripts: Custom scripts to include in the header

🎨 Customization

Views

If you published the views, you can customize them at:

resources/views/vendor/laravel-settings

Translations

The package supports translations through Laravel's localization system. To publish translations:

php artisan vendor:publish --tag=laravel-settings-translations

🧪 Testing

composer test

📄 License

The MIT License (MIT). Please see License File for more information.

mt-settings/laravel-settings 适用场景与选型建议

mt-settings/laravel-settings 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 05 月 08 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 mt-settings/laravel-settings 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 mt-settings/laravel-settings 我们能提供哪些服务?
定制开发 / 二次开发

基于 mt-settings/laravel-settings 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-05-08