Diagnose FilamentPHP v4 errors and issues using official documentation to find solutions
Diagnoses and fixes FilamentPHP v4 errors by analyzing issues and consulting official documentation.
/plugin marketplace add mwguerra/claude-code-plugins/plugin install post-development@mwguerra-marketplace<error-message-or-issue-description>Diagnose and fix FilamentPHP v4 issues by consulting official documentation and analyzing error patterns.
# Diagnose an error
/filament:diagnose "Target class [App\Filament\Resources\PostResource] does not exist"
# Diagnose a behavior issue
/filament:diagnose "form fields not saving to database"
# Diagnose a display issue
/filament:diagnose "table not showing any records"
Parse the error or issue description to identify:
Read relevant documentation files:
/home/mwguerra/projects/mwguerra/claude-code-plugins/filament-specialist/skills/filament-docs/references/php artisan optimize:clearfillable on modelpreload() or searchable()$navigationIcon and panel registration$navigationSort$navigationGroupcanViewAny, canCreate, etc.storage/logs/laravel.logphp artisan optimize:clear
php artisan filament:clear-cached-components
composer show filament/filamentphp artisan aboutCauses:
Solutions:
// In AdminPanelProvider.php
->discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources')
// Or explicit registration
->resources([
PostResource::class,
])
Causes:
$fillableSolutions:
// Model
protected $fillable = ['title', 'content', 'status'];
// Form field name must match
TextInput::make('title') // Must match model attribute
Causes:
Solutions:
// Model must have the relationship
public function author(): BelongsTo
{
return $this->belongsTo(User::class);
}
// Form field must match
Select::make('author_id')
->relationship('author', 'name')
Causes:
Solutions:
// Check the query
public static function getEloquentQuery(): Builder
{
return parent::getEloquentQuery()
->withoutGlobalScopes([SoftDeletingScope::class]);
}
Causes:
Solutions:
php artisan optimize:clear
php artisan filament:clear-cached-components
composer dump-autoload
Causes:
Solutions:
// Make sure to use correct imports
use Filament\Tables\Actions\DeleteAction; // For tables
use Filament\Actions\DeleteAction; // For pages
// Check visibility
->visible(fn (Model $record): bool => $record->status === 'draft')
Causes:
Solutions:
TextInput::make('email')
->email()
->required()
->unique(ignoreRecord: true)
// Use rules() for complex validation
->rules(['required', 'email', 'max:255']);
Provide:
After solving the issue, log it to ~/claude-docs/solved-errors.md with: