shebaoting / filament-plugins
使用插件生成器将您的模块作为插件系统管理
Requires
- php: ^8.1|^8.2
- calebporzio/sushi: *
- filament/filament: ^3.0.0
- filament/notifications: ^3.0.0
- nwidart/laravel-modules: ^11.0
- tomatophp/console-helpers: ^1.1
- tomatophp/filament-icons: *@dev
This package is auto-updated.
Last update: 2024-09-09 04:48:56 UTC
README
Filament插件
使用插件生成器将您的模块作为插件系统管理
屏幕截图
安装
composer require shebaoting/filament-plugins
安装您的包后,请运行此命令
php artisan filament-plugins:install
默认情况下,模块类不会自动加载。您可以通过将merge-plugin添加到额外部分来自动加载您的模块
"extra": { "laravel": { "dont-discover": [] }, "merge-plugin": { "include": [ "Modules/*/composer.json" ] } },
现在您需要运行此命令来自动加载您的模块
composer dump-autoload
最后,在 /app/Providers/Filament/AdminPanelProvider.php
上注册插件
->plugin(\Shebaoting\FilamentPlugins\FilamentPluginsPlugin::make())
用法
您只需使用一条命令即可创建新的插件
php artisan filament-plugins:generate
或者您可以使用GUI创建新的插件,创建插件后,请确保它通过运行此命令在composer中加载
composer dump-autoload
创建插件后,您可以在其中创建一个新的表,然后运行迁移生成器将其转换为迁移文件,然后您可以使用GUI生成资源、页面、小部件或模型,或者您可以轻松使用以下命令
php artisan filament-plugins:model php artisan filament-plugins:resource php artisan filament-plugins:page php artisan filament-plugins:widget
它将为您生成文件,您可以直接使用它,请注意,您需要首先生成模型,然后才能使用其他命令
在插件列表上列出您的包
您可以通过在包根目录中添加名为 filament-plugin.json
的JSON文件来在插件列表上列出您的包
{ "name": "FilamentAccounts", "alias": "filament-accounts", "description": { "ar": "full accounts manager with API\/Notifications\/Contacts to manage your contacts and accounts", "en": "full accounts manager with API\/Notifications\/Contacts to manage your contacts and accounts", "gr": "full accounts manager with API\/Notifications\/Contacts to manage your contacts and accounts", "sp": "full accounts manager with API\/Notifications\/Contacts to manage your contacts and accounts" }, "keywords": [], "priority": 0, "providers": [ "Shebaoting\\FilamentAccounts\\FilamentAccountsServiceProvider" ], "files": [], "title": { "ar": "Filament Accounts", "en": "Filament Accounts", "gr": "Filament Accounts", "sp": "Filament Accounts" }, "color": "#007dff", "icon": "heroicon-c-user-circle", "placeholder": "placeholder.webp", "type": "lib", "version": "v1.0", "github" : "https://github.com/Shebaoting/filament-accounts", "docs" : "https://github.com/Shebaoting/filament-accounts" }
确保在 filament-plugins.php
配置文件中允许包扫描
'scan' => true
在您的面板中使用选定的模块
您可以通过在PanelProvider中使用以下代码在您的面板中使用选定的模块
->plugin(\Shebaoting\FilamentPlugins\FilamentPluginsPlugin::make()->modules([ 'CRM' ]))
这样,您将只在面板中看到选定的模块
仅获取当前面板插件
在任何一个插件上,您都可以为选定的面板创建页面/资源/小部件,因此如果您只想显示当前面板的页面/资源/小部件,您可以在PanelProvider中使用此代码
->plugin(\Shebaoting\FilamentPlugins\FilamentPluginsPlugin::make()->discoverCurrentPanelOnly())
停止自动发现模块资源
您可以使用PanelProvider中的以下代码停止自动加载模块资源
->plugin(\Shebaoting\FilamentPlugins\FilamentPluginsPlugin::make()->autoDiscoverModules(false))
停止使用插件UI
您可以通过在PanelProvider中使用以下代码停止使用插件UI
->plugin(\Shebaoting\FilamentPlugins\FilamentPluginsPlugin::make()->useUI(false))
发布资产
您可以使用此命令发布配置文件
php artisan vendor:publish --tag="filament-plugins-config"
您可以使用此命令发布视图文件
php artisan vendor:publish --tag="filament-plugins-views"
您可以使用此命令发布语言文件
php artisan vendor:publish --tag="filament-plugins-lang"
您可以使用此命令发布迁移文件
php artisan vendor:publish --tag="filament-plugins-migrations"
其他Filament包
- Filament用户
- Filament翻译
- Filament设置中心
- Filament警报发送器
- Filament账户构建器
- Filament钱包管理器
- Filament artisan运行器
- Filament文件浏览器
- Filament开发者门
- Filament位置播种器
- Filament菜单生成器
- Filament Splade集成
- Filament类型管理器
- Filament图标选择器
- Filament助手类
支持
您可以加入我们的Discord服务器以获取支持 Shebaoting
文档
您可以在 Docs 上查看此包的文档
变更日志
请参阅 CHANGELOG 了解最近更改的更多信息。
安全
请参阅 SECURITY 了解有关安全性的更多信息。
鸣谢
许可证
MIT许可证(MIT)。更多信息请参阅许可证文件。