sakanjo/filament-easy-testings
最新稳定版本:v2.0.0
Composer 安装命令:
composer require sakanjo/filament-easy-testings
包简介
Filament plugin to make testing easier
README 文档
README
A Filament plugin to make testing easier.
✨ Help support the maintenance of this package by sponsoring me.
Table of Contents
📦 Install
Install the package via composer:
composer require sakanjo/filament-easy-testings
🦄 Usage
<?php // ... use SaKanjo\FilamentEasyTestings\EasyTestingPlugin; use App\Filament\EasyTestings\Presets\MyPreset; public function panel(Panel $panel): Panel { return $panel ->plugin( EasyTestingPlugin::make() ->preset(MyPreset::make()) ); }
Presets
Presets are the core of the plugin, allows you to create different tests with no limit.
Default presets
The package comes with a default preset that you can use out of the box.
DefaultPresetEnvPresetWebsocketPreset
Creating custom preset
You can create your own custom preset by extending the SaKanjo\FilamentEasyTestings\Presets\Preset class.
<?php namespace App\Filament\EasyTestings; use Filament\Forms; use Filament\Schemas; use Filament\Actions; use Filament\Notifications\Notification; use SaKanjo\FilamentEasyTestings\Pages\TestingsPage; use SaKanjo\FilamentEasyTestings\Presets\Preset; class HelloPreset extends Preset { public static function components(): array { return [ Schemas\Components\Section::make('Say hi') ->persistCollapsed() ->icon('heroicon-m-bolt') ->components([ Forms\Components\TextInput::make('name') ->label('Name') ->required(), Schemas\Components\Actions::make([ Actions\Action::make('submit') ->action(function (Forms\Get $get, TestingsPage $livewire): void { $livewire->validateFields(['name']); $name = $get('name'); Notification::make() ->title("Hello $name") ->send(); }), ]), ]), ]; } }
💖 Support the development
Do you like this project? Support it by donating
Click the "💖 Sponsor" at the top of this repo.
©️ Credits
📄 License
MIT License © 2023-PRESENT Salah Kanjo
统计信息
- 总下载量: 29
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-01-21
