oriondevelops / nova-greeter
一个Laravel Nova问候卡。
v0.0.2
2024-08-02 09:32 UTC
Requires
- php: ^8.0
- laravel/nova: ^4.0
README
这个Laravel Nova包可以为您的仪表板添加一个可定制的问候卡。
安装
您可以通过composer安装此包
composer require oriondevelops/nova-greeter
用法
use Orion\NovaGreeter\GreeterCard; // ... public function cards() { return [ // ... GreeterCard::make() ->user(name: 'John Doe', title: 'The King in the North') ->avatar(url: 'https://ui-avatars.com/api/?size=300&color=7F9CF5&background=EBF4FF&name=John+Doe'), ]; }
消息
->message(text: 'Welcome back,')
按钮
->button(name: 'Call To Action', target: '/nova/resources/users')
头像
->avatar(url: $avatarUrl ?? $placeholderAvatarUrl)
验证
->verified(text: 'Verified Account')
示例
GreeterCard::make() ->user(name: 'ORION', title: 'Admin') ->message(text: 'Welcome back,') ->button(name: 'See users', target: '/nova/resources/users') ->avatar(url: 'https://avatars.githubusercontent.com/u/39307250') ->width('1/2'),
本地化
可以使用以下命令发布翻译文件
php artisan vendor:publish --provider="Orion\NovaGreeter\CardServiceProvider"
致谢
许可证
MIT许可证(MIT)。请参阅许可证文件获取更多信息。