murdercode / laravel-admin-bar
Laravel 管理栏
v1.0.5
2024-03-18 13:57 UTC
Requires
- php: ^8.1|^8.2|^8.3
- illuminate/contracts: ^9.0|^10.0|^11.0
- spatie/laravel-package-tools: ^1.13.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^6.0
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^7.0
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2024-09-18 15:02:16 UTC
README
这是一个简单但强大的包,可以用于在您的下一个优秀的 Laravel 项目中包含管理栏(如 WordPress)。
安装
您可以通过 composer 安装此包
composer require murdercode/laravel-admin-bar
您可以使用以下命令发布配置文件
php artisan vendor:publish --tag="admin-bar-config"
这是已发布配置文件的内容
<?php // config for Murdercode/LaravelAdminBar return [ 'style' => [ 'show3labsLogo' => true, 'theme' => 'dark', // 'light' or 'dark' 'max-width' => '1200px', 'position' => 'bottom', // 'top' or 'bottom' 'font-size' => '14px', ], 'config' => [ 'adminUrl' => '/cms', 'editPost' => [ 'enabled' => true, 'uris' => ['articoli/{slug}', 'notizie/{slug}', 'recensioni/{slug}'], // detect the current route as defined in your routes/web.php 'wildcard' => 'slug', // the wildcard for the parameter (as over) 'parameterForSearch' => 'slug', // the parameter to be used for search the post 'model' => \App\Models\Post::class, // the model to be used for search the post 'parameterToReturn' => 'id', // the value to be returned 'targetEndpointUrl' => '/cms/resources/posts/{parameter}', ], 'emptyCachePost' => [ 'enabled' => true, 'uris' => ['articoli/{slug}', 'notizie/{slug}', 'recensioni/{slug}'], // detect the current route as defined in your routes/web.php 'wildcard' => 'post', // the wildcard for the parameter (as over) 'parameterForSearch' => 'slug', // the parameter to be used for search the post 'model' => \App\Models\Post::class, // the model to be used for search the post 'parameterToReturn' => 'id', // the value to be returned 'targetEndpointUrl' => '/posts/{parameter}?nocache', ], ], ];
可选地,您可以使用以下命令发布视图
php artisan vendor:publish --tag="laravel-admin-bar-views"
用法
在布局的任何部分,您可以使用以下代码包含管理栏
{{LaravelAdminBar::render()}}
测试
composer test
变更日志
有关最近更改的更多信息,请参阅 CHANGELOG。
贡献
有关详细信息,请参阅 CONTRIBUTING。
安全漏洞
有关如何报告安全漏洞,请参阅 我们的安全策略。
鸣谢
许可证
MIT 许可证(MIT)。有关更多信息,请参阅 许可证文件。