solution-forest / grid-layout-plugin
此包已被废弃,不再维护。未建议替代包。
这是 Filament Admin 的网格布局插件
0.0.1
2023-03-20 09:23 UTC
Requires
- php: ^8.0
- filament/filament: ^2.0
- spatie/laravel-package-tools: ^1.13.5
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^6.0
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^7.0
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- pestphp/pest-plugin-livewire: ^1.0
- pestphp/pest-plugin-parallel: ^0.3
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^9.5
- spatie/laravel-ray: ^1.26
This package is not auto-updated.
Last update: 2023-12-26 11:26:04 UTC
README
重要
由于 filament3 现在支持网格,我们将存档此项目。https://beta.filamentphp.com/docs/3.x/infolists/layout/grid
网格布局插件
这是 Filament Admin 的网格布局插件
安装
您可以通过 composer 安装此包
composer require solution-forest/grid-layout-plugin
可选地,您可以使用以下命令发布视图:
php artisan vendor:publish --tag="grid-layout-plugin-views"
使用方法
要创建网格布局页面
php artisan make:filament-grid-page
使用 getGridSchema()
方法来定义网格布局的结构。它是一个字段数组,按照它们在布局中出现的顺序。
以下组件可用于网格布局
- \SolutionForest\GridLayoutPlugin\Components\Grid\Row
- \Livewire\Component
- \Illuminate\View\Component
- \Illuminate\Support\HtmlString
use SolutionForest\GridLayoutPlugin\Pages\Grid as BasePage; use SolutionForest\GridLayoutPlugin\Components\Grid; use SolutionForest\GridLayoutPlugin\Components\Grid\Row; use SolutionForest\GridLayoutPlugin\Components\Grid\Column; protected function getGridSchema(): array { return [ Components\Grid\Row::make([ Components\Grid\Column::make( 6, \Filament\Widgets\StatsOverviewWidget\Card::make('Revenue', '$192.1k') ->description('32k increase') ->descriptionIcon('heroicon-s-trending-up') ->chart([7, 2, 10, 3, 15, 4, 17]) ->color('success'), ), Components\Grid\Column::make( 6, \Filament\Widgets\StatsOverviewWidget\Card::make('Revenue', '$192.1k') ->description('3% decrease') ->descriptionIcon('heroicon-s-trending-down') ->chart([17, 16, 14, 15, 14, 13, 12]) ->color('danger') ), ]), \Filament\Widgets\StatsOverviewWidget\Card::make('Revenue', '$192.1k') ->description('7% increase') ->descriptionIcon('heroicon-s-trending-up') ->chart([15, 4, 10, 2, 12, 4, 12]) ->color('success'), new \Illuminate\Support\HtmlString("<div>Dummy Html Element</div>"), view('welcome'), ]; }
或者,您可以创建仅支持类似 \Filament\Pages\Dashboard
的小部件的网格布局
php artisan make:filament-grid-page --type=widget
protected function getWidgets(): array { return [ \Filament\Widgets\AccountWidget::class, \Filament\Widgets\FilamentInfoWidget::class, ]; }
测试
composer test
变更日志
请参阅 CHANGELOG 了解最近更改的详细信息。
贡献
请参阅 CONTRIBUTING 了解详细信息。
安全漏洞
请参阅 我们的安全策略 了解如何报告安全漏洞。
致谢
许可
MIT 许可证 (MIT)。请参阅 许可文件 了解更多信息。