Table Actions Namespace Fix

📄 General
← Back to Documentation
# Table Actions Namespace Fix ## Problem All Table classes are using incorrect action imports from `Filament\Actions\*` instead of `Filament\Tables\Actions\*`. This causes the error: ``` Class "Filament\Tables\Actions\ViewAction" not found ``` ## Solution Replace all `Filament\Actions\` imports with `Filament\Tables\Actions\` in all Table classes. ## Pattern to Fix ### WRONG (Current): ```php use Filament\Actions\ActionGroup; use Filament\Actions\ViewAction; use Filament\Actions\EditAction; use Filament\Actions\DeleteAction; use Filament\Actions\BulkActionGroup; use Filament\Actions\DeleteBulkAction; ``` ### CORRECT (Should be): ```php use Filament\Actions\ActionGroup; use Filament\Actions\ViewAction; use Filament\Actions\EditAction; use Filament\Actions\DeleteAction; use Filament\Actions\BulkActionGroup; use Filament\Actions\DeleteBulkAction; ``` ## Files Fixed - ✅ ClientTable.php - ✅ ServiceResource/Tables/ServiceTable.php (already correct) ## Files Needing Fix All files in `app/Filament/Components/Tables/`: - FiscalReceiptQueueTable.php - GalleryItemTable.php - GalleryTable.php - OperatorTable.php - InvoiceTable.php - ProductTable.php - ReceiptTable.php - ReservationTable.php - ReviewTable.php - UserTable.php - VenueFacilityTable.php - VenueObjectTable.php - VenueObjectTypeTable.php - VenueSpotTable.php - VenueTable.php - WorkspaceTable.php - PaymentTransactionTable.php (partially fixed) All files in `app/Filament/Resources/*/Tables/`: - ReservationResource/Tables/ReservationTable.php - ClientResource/Tables/ClientTable.php - InvoiceResource/Tables/InvoiceTable.php - PackageResource/Tables/PackageTable.php (already correct) All files in `app/Filament/Client/Components/Tables/`: - PreferenceTable.php - ClientReservationTable.php ## PowerShell Command to Fix All Files Run this in PowerShell from the project root: ```powershell # Fix all Table files Get-ChildItem -Path "app\Filament" -Filter "*Table.php" -Recurse | ForEach-Object { $content = Get-Content $_.FullName -Raw $updated = $content -replace 'use Filament\\Actions\\', 'use Filament\\Tables\\Actions\\' if ($content -ne $updated) { Set-Content -Path $_.FullName -Value $updated -NoNewline Write-Host "Fixed: $($_.FullName)" } } ``` ## Verification Command After running the fix, verify no incorrect imports remain: ```powershell # Search for any remaining incorrect imports in Table files Get-ChildItem -Path "app\Filament" -Filter "*Table.php" -Recurse | Select-String -Pattern "^use Filament\\Actions\\" | Select-Object Path, LineNumber, Line ``` Should return NO results if all fixed correctly. ## Important Notes 1. **Table classes** must use `Filament\Tables\Actions\*` 2. **Resource classes** use `Filament\Actions\*` 3. This is a Filament v4 requirement - the namespaces are intentionally different 4. After fixing, clear cache: `php artisan cache:clear`