oriondevelops/filament-greeter
Composer 安装命令:
composer require oriondevelops/filament-greeter
包简介
A Filament plugin to greet your users.
README 文档
README
This Filament plugin is the sibling of nova-greeter that extends the default account widget and lets you:
- Give yourself and your users fancy titles
- Add a custom action
- Change welcome message
- Change avatar size
- Disable avatar
Installation
You can install the package via composer:
composer require oriondevelops/filament-greeter
Usage
You need to register the plugin with your preferred Filament panel providers. This can be done inside your PanelProvider, e.g. AdminPanelProvider.
<?php namespace App\Providers\Filament; use Filament\Panel; use Filament\PanelProvider; use Filament\Actions\Action; use Orion\FilamentBackup\BackupPlugin; use Orion\FilamentGreeter\GreeterPlugin; use Orion\FilamentFeedback\FeedbackPlugin; class AdminPanelProvider extends PanelProvider { public function panel(Panel $panel): Panel { return $panel // ... ->plugins([ BackupPlugin::make() ->queue('monitors'), // ... GreeterPlugin::make() ->message('Welcome,') ->name('Daenerys Targaryen') ->title('The First of Her Name, the Unburnt, Queen of Meereen, Queen of the Andals and the Rhoynar and the First Men, Khalisee of the Great Grass Sea, Breaker of Chains and Mother of Dragons') ->avatar(size: 'w-16 h-16', url: 'https://avatarfiles.alphacoders.com/236/236674.jpg') ->action( Action::make('action') ->label('Buy more unsullied') ->icon('heroicon-o-shopping-cart') ->url('https://buyunsulliedonline.com') ) ->sort(-1) ->columnSpan('full'), // ... FeedbackPlugin::make() ->sendResponsesTo(email: 'oriondevelops@gmail.com'), ]) } }
Message
->message(text: 'Welcome')
To determine the welcome message dynamically you can use a closure:
->message(text: fn() => auth()->user()->hasRole('Super Administrator') ? __('Welcome my lord') : __('Welcome'))
Time-Sensitive Greeting
->timeSensitive(morningStart: 6, afternoonStart: 12, eveningStart: 17, nightStart: 22)
The greeting message will change to "Good morning", "Good afternoon", "Good evening", or "Good night" based on the current time. You can omit the hour parameters to use the default times.
Title
->title(text: 'Administrator', enabled: true)
To change the title based on the user you can use a closure:
->title(text: fn() => auth()->user()->title)
Avatar
->avatar(size: 'lg', enabled: true),
Action
->action( Action::make('action') ->label('Buy more unsullied') ->icon('heroicon-o-shopping-cart') ->url('https://buyunsulliedonline.com') )
Customizing visibility
<?php namespace App\Providers\Filament; use Filament\Panel; use Filament\PanelProvider; use Orion\FilamentGreeter\GreeterPlugin; class AdminPanelProvider extends PanelProvider { public function panel(Panel $panel): Panel { return $panel // ... ->plugin( GreeterPlugin::make() ->visible(fn() => auth()->user()->can('view greeter')) // OR ->hidden(fn() => auth()->user()->cannot('view greeter')), ); } }
Examples
GreeterPlugin::make()
->message('Welcome')
->name("Rand al'Thor")
->title("Dragon Reborn, Coramoor, Car'a'carn, He Who Comes With the Dawn, Shadowkiller, King of Illian, Lord of the Morning")
->avatar(size: 'w-16 h-16')
->columnSpan('full')
->action(
Action::make('action')
->label('Reborn')
->color('danger')
->icon('heroicon-o-arrow-path')
->action(function () {
Notification::make()
->title('Reborn successfully')
->success()
->send();
})
),
GreeterPlugin::make()
->message('Welcome')
->name("Annatar")
->action(
Action::make('action')
->label('Gift a ring')
->color('warning')
->icon('heroicon-o-gift')
->action(function () {
Notification::make()
->title('Target deceived successfully')
->warning()
->send();
})
),
GreeterPlugin::make()
->avatar(enabled: false),
GreeterPlugin::make()
->timeSensitive()
->name('Ser Arthur Dayne')
->title('Sword of the Morning')
->avatar(size: 'w-16 h-16')
->columnSpan('full')
->action(
Action::make('action')
->label('Protect the Heir')
->icon('heroicon-o-shield-check')
->action(fn () => Notification::make()->title('You failed! You’ve been stabbed in the back.')->danger()->send())
),
Contributing
Please see CONTRIBUTING for details.
Security
Please review Security Policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
oriondevelops/filament-greeter 适用场景与选型建议
oriondevelops/filament-greeter 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 15.46k 次下载、GitHub Stars 达 12, 最近一次更新时间为 2024 年 08 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「widget」 「filament」 「oriondevelops」 「greeter」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 oriondevelops/filament-greeter 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 oriondevelops/filament-greeter 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 oriondevelops/filament-greeter 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Yii2 LightBox image galary widget uses Lightbox v2.10.0 by Lokesh Dhakar
Add a weather widget to Flarum
Yii2 prettyPhoto image galary widget uses Lightbox view control jquery.prettyphoto.js
Yii2 DynaTree Menu widget uses Dynamic tree view control jquery.dynatree.js
Add sidebar that can be collapsed to smaller version
Alfabank REST API integration
统计信息
- 总下载量: 15.46k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 12
- 点击次数: 16
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-08-22



