noith/orchid-settings
Composer 安装命令:
composer require noith/orchid-settings
包简介
Flexible settings CRUD for Laravel and Orchid
关键字:
README 文档
README
Flexible settings CRUD for Laravel Orchid.
Adds a tabbed settings screen to the Orchid admin panel. Tabs and fields are defined in your app's service provider. Persists values via noith/settings.
Installation
composer require noith/orchid-settings
php artisan optimize:clear
Grant the platform.settings permission to the roles that should access the settings screen.
Usage
Add the HasSettings trait to your existing PlatformProvider and define a settings() method returning tabs:
use Noith\OrchidSettings\Traits\HasSettings;
use Orchid\Platform\OrchidServiceProvider;
class PlatformProvider extends OrchidServiceProvider
{
use HasSettings;
public function settings(): array
{
return [
'General' => [
Input::make('site_name')->title('Site name'),
Input::make('site_email')->title('Email'),
],
'SEO' => [
Input::make('meta_title')->title('Meta title'),
Textarea::make('meta_description')->title('Meta description'),
],
];
}
}
No changes to boot() or registration are needed. The package discovers HasSettings automatically.
Reading settings
use Noith\Settings\Repositories\SettingsRepository;
$settings = app(SettingsRepository::class);
$siteName = $settings->get('site_name');
// or via helper
$siteName = settings('site_name');
License
MIT
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-06-04