attargah/admin-bar
Composer 安装命令:
composer require attargah/admin-bar
包简介
This package adds an admin bar for the front pages of websites built with Filament.
关键字:
README 文档
README
Admin Bar
Admin Bar is a Laravel package built for Filament that displays a fixed admin bar on the frontend of your site when a user is logged in. This bar provides quick access to the Filament panel and can be easily integrated into various projects with its customizable structure.
🔧 Features
- Fixed top bar display for authenticated users
- Quick access link to the Filament panel
- Customizable settings (logo, title, colors, height, etc.)
- Extendable structure with Filament Render Hook points
⚙️ Requirements
- PHP >= 8.1
- Laravel >= 10
- Filament >= 3.0 | 4.0
- Tailwind CSS (for component styling)
🚀 Installation
composer require attargah/admin-bar
📦 Publishing (Optional)
To publish the default files:
php artisan vendor:publish --provider="Attargah\AdminBar\AdminBarServiceProvider"
🧹 Usage
Add the plugin to your AdminPanelProvider:
use Attargah\AdminBar\AdminBarPlugin; ->plugins([AdminBarPlugin::make()])
🎨 Customization
AdminBarPlugin::make() ->setBarTextColor('text-white') ->setBarBackgroundColor('bg-gray-900') ->setBarCustomClass('') ->setBarHeight('h-12') ->setBarTitleFont('font-bold text-lg') ->setBarMenuItemsFont('text-sm') ->setBarMenuTitleFont('uppercase') ->setBarTitle('Admin Panel') ->setAuthMenuEnable(true) ->setLogoHeight('h-8') ->setLogoUrl('https://example.com/image.png')
If a logo is defined, the title will not be shown.
If both the logo and title are not defined, the default text Admin Panel will be displayed.
All customizations are using TailwindCSS classes.
🧱 Blade Component Usage
Add the following to the Blade file where you want the admin bar to appear:
<x-admin-bar-admin-bar />
This component needs Tailwind CSS to look correct on your page.
The bar will only appear for authenticated users.
To customize further, you can publish and modify the resources/views/components/admin-bar.blade.php file.
🔌 Render Hook Points
To extend the admin bar, use the following render hook points:
| Hook Point | Description |
|---|---|
BEFORE_TITLE |
Before the title |
AFTER_TITLE |
After the title |
BEFORE_AUTH_MENU |
Before the auth user menu |
AFTER_AUTH_MENU |
After the auth user menu |
BEFORE_AUTH_MENU_ITEMS |
Before the menu items |
AFTER_AUTH_MENU_ITEMS |
After the menu items |
BETWEEN_AUTH_MENU_ITEMS |
Between each menu item |
Example: Adding a new item to the auth menu
use Filament\Panel; use Filament\Support\Facades\FilamentView; use Attargah\AdminBar\Enums\AdminBarRenderHook; FilamentView::registerRenderHook( AdminBarRenderHook::BETWEEN_AUTH_MENU_ITEMS, fn () => ' <li> <a href="'.route('settings-route').'" class="block break-words whitespace-normal px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"> Settings </a> </li> ', );
For more, check out the Filament Render Hooks documentation.
🌍 Translations
To customize translations, publish the resources/lang/en/admin-bar.php file:
php artisan vendor:publish --tag=admin-bar-translations
📄 License
This project is licensed under the MIT license.
🤝 Contributing
Visit our GitHub page for pull requests and bug reports:
👉 https://github.com/attargah/admin-bar
attargah/admin-bar 适用场景与选型建议
attargah/admin-bar 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.35k 次下载、GitHub Stars 达 6, 最近一次更新时间为 2025 年 06 月 25 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「admin-bar」 「attargah」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 attargah/admin-bar 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 attargah/admin-bar 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 attargah/admin-bar 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Front-end shortcuts for clients logged into Craft CMS.
GogetSSL API integration for Laravel framework
A Filament plugin to protect frontend forms from spam/scam bots with IP blocking and a blacklist management panel.
Alfabank REST API integration
Laravel package for Accurate Online API integration.
Frontend admin bar for the Sulu CMS: edit the current page or custom entity, add new content and log out, directly from the website.
统计信息
- 总下载量: 1.35k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 10
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-06-25
