https://github.com/pkg6/laravel-settings
Store Laravel application settings in the database.
https://github.com/pkg6/laravel-settings
Last synced: about 1 month ago
JSON representation
Store Laravel application settings in the database.
- Host: GitHub
- URL: https://github.com/pkg6/laravel-settings
- Owner: pkg6
- License: mit
- Created: 2024-12-16T01:13:40.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-12-25T07:46:08.000Z (5 months ago)
- Last Synced: 2025-03-24T20:42:56.937Z (2 months ago)
- Language: PHP
- Homepage: https://packagist.org/packages/pkg6/laravel-settings
- Size: 7.81 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### 安装
```
composer require pkg6/laravel-settings
```### 在 `config/app.php` 注册
```
'providers' => [
.....
\Pkg6\Laravel\Settings\SettingsServiceProvider::class
]php artisan vendor:publish --provider="\Pkg6\Laravel\Settings\SettingsServiceProvider::class"
php artisan vendor:publish --tag="settings"php artisan migrate --path=database/migrations/2024_12_16_122545_create_settings_table.php
```### 基本使用
~~~
// Setting
Settings::set('foo', 'bar');
settings()->set('foo', 'bar');
settings(['foo' => 'bar']);// Retrieving
Settings::get('foo'); // 'bar'
settings()->get('foo');
settings('foo');
~~~