sakanjo / filament-easy-testings
Filament plugin to make testing easier
Fund package maintenance!
sakanjo
Requires
- php: ^8.2
- filament/filament: ^3.2
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- laravel/pint: ^1.1
- orchestra/testbench: ^9.0
- pestphp/pest: ^2.3
- pestphp/pest-plugin-livewire: ^2.1
- phpstan/phpstan: ^1.1
This package is auto-updated.
Last update: 2025-01-21 06:28:12 UTC
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.
DefaultPreset
EnvPreset
WebsocketPreset
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\Notifications\Notification; use SaKanjo\FilamentEasyTestings\Pages\TestingsPage; use SaKanjo\FilamentEasyTestings\Presets\Preset; class HelloPreset extends Preset { public static function schema(): array { return [ Forms\Components\Section::make('Say hi') ->persistCollapsed() ->icon('heroicon-m-bolt') ->schema([ Forms\Components\TextInput::make('name') ->label('Name') ->required(), Forms\Components\Actions::make([ Forms\Components\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