eightynine / filament-page-alerts
在任何纤维页面上显示更多侵入性警报
v3.0.0
2024-07-21 15:46 UTC
Requires
- php: ^8.1
- filament/filament: ^3.0
- spatie/laravel-package-tools: ^1.15.0
Requires (Dev)
- nunomaduro/collision: ^7.9
- orchestra/testbench: ^8.0
- pestphp/pest: ^2.1
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
README
在任何纤维页面上显示更具侵略性的警报
🛠️ 加入我们的旅程
嗨,我是Eighty Nine。我创建了页面警报插件来解决作为开发者所面临的真实问题。您的赞助将使我能够投入更多时间来增强这些工具并帮助更多的人。 成为赞助商 并与我一起在开发者社区中产生积极影响。
简介
此包在任何页面上显示警报,而不仅仅是仪表板,目前警报出现在页面顶部。
安装
您可以通过composer安装此包
composer require eightynine/filament-page-alerts
您可以使用以下命令发布配置文件
php artisan vendor:publish --tag="filament-page-alerts-config"
这是已发布配置文件的内容
use Filament\View\PanelsRenderHook; return [ /** * Render hook * * The render hook to use for the alerts */ "render-hook" => PanelsRenderHook::PAGE_START ];
用法
将插件添加到您的面板服务提供商
public function panel(Panel $panel): Panel { return $panel //... //... ->plugin(FilamentPageAlertsPlugin::make()) ->spa(); }
您可以使用PageAlert
类向您的页面发送警报!
return [ Actions\CreateAction::make(), Actions\Action::make('show notification') ->action(function () { PageAlert::make() ->title('Saved successfully') ->body('Yey.. Your changes have been saved: ' . now()) ->success() ->send(); PageAlert::make() ->title('Saved failure') ->body('Ooops, Your changes have not been saved! ') ->danger() ->send(); PageAlert::make() ->title('This requires your attention') ->body('Hey there, this is important') ->warning() ->url('https://www.google.com', 'Google') ->send(); PageAlert::make() ->title('You need to check this out') ->body('This looks like something worth your attention') ->info() ->send(); }), ];
致谢
许可证
MIT许可证(MIT)。请参阅许可证文件了解更多信息。