novius/laravel-filament-action-preview
Add a Filament table action that opens a front-end preview URL for a resource record. Works with a model previewUrl() method or a custom URL callback via using(). Supports Laravel 11+ and Filament v4.
posts.show → /posts/{id}).getPreviewUrl() in resource classes./blog/my-post)./posts/1) or dynamic (e.g., /posts/{slug})?->route('posts.show') if missing).composer require novius/laravel-filament-action-preview
Publish config (if needed):
php artisan vendor:publish --provider="Novius\FilamentActionPreview\FilamentActionPreviewServiceProvider"
use Novius\FilamentActionPreview\Actions\PreviewAction;
public static function getActions(): array
{
return [
PreviewAction::make(),
];
}
getPreviewUrl() in resource class:
public function getPreviewUrl(): string
{
return route('posts.show', $this->slug);
}
visible(), requiresConfirmation()).getPreviewUrl().getPreviewUrl() must be maintained if frontend routes change.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Missing frontend route | Broken preview link (404) | Add fallback URL or validation. |
| Filament version mismatch | Action fails to load | Pin to a specific Filament minor version. |
| AGPL compliance violation | Legal risk if code is redistributed | Use only in private repos or buy license. |
| Dynamic slug generation error | Incorrect preview URL | Test with edge cases (e.g., special chars). |
| Frontend timeout | Slow preview response | Add loading state or timeout handling. |
getPreviewUrl() and verify action rendering.How can I help you explore Laravel packages today?