codewithdennis/filament-factory-action
Resource class).filament/filament and laravel/framework).FactoryAction), allowing customization via PHP classes (e.g., overriding getFactory() or handle()).^3.0).test environments or specific roles)?php artisan db:seed or telescope:fake serve similar needs with less UI overhead?filament/filament).composer require codewithdennis/filament-factory-action
Publish config/assets if needed (unlikely; package is minimal).Resource class:
use CodeWithDennis\FilamentFactoryAction\Actions\FactoryAction;
public static function tableActions(): array
{
return [
FactoryAction::make()
->label('Generate Test Data')
->factory(ProfileFactory::new()),
];
}
laravel-breeze factories).ProfileResource).factory() helper, Filament’s action logs.APP_ENV=local):
FactoryAction::make()
->visible(fn () => app()->environment('local')),
| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Factory validation errors | UI fails silently or shows errors. | Add error handling in handle() method. |
| Missing factories | Action disabled or throws errors. | Validate factories exist pre-deployment. |
| Database constraints (e.g., unique) | Test data conflicts with prod data. | Use soft deletes or test-specific DB. |
| Filament action system changes | Package breaks with Filament update. | Pin Filament version or fork the package. |
| Unauthorized access | Sensitive data exposed. | Add gate checks (e.g., authorize()). |
ProfileFactory::new()").jobs:
test:
runs-on: ubuntu-latest
steps:
- run: php artisan db:seed --class=TestDataSeeder # Fallback if UI isn’t used
How can I help you explore Laravel packages today?