This package allows you to add Laravel Filament action to open the front preview url of a ressource.
- Laravel Filament >= 3.3
- Laravel >= 12.0
- Laravel >= 8.2
You can install the package via composer:
composer require novius/laravel-filament-action-preview
This package provides the following actions:
\Novius\LaravelFilamentActionPreview\Filament\Tables\Actions\PreviewAction
for Tables\Novius\LaravelFilamentActionPreview\Filament\Actions\PreviewAction
otherwise
use Filament\Resources\Resource;
use Novius\LaravelFilamentActionPreview\Filament\Tables\Actions\PreviewAction;
class Post extends Resource
{
public static function table(Table $table): Table
{
return $table
->actions([
PreviewAction::make(),
]);
}
use App\Models\Post as PostModel;
use Filament\Resources\Resource;
use Novius\LaravelFilamentActionPreview\Filament\Tables\Actions\PreviewAction;
class Post extends Resource
{
public static function table(Table $table): Table
{
return $table
->actions([
PreviewAction::make()
->using(function(PostModel $record) {
return route('post.preview', ['post' => $record]);
}),
]);
}
If you want to customize the lang files, you can publish them with:
php artisan vendor:publish --provider="Novius\LaravelFilamentActionPreview\LaravelFilamentActionPreviewServiceProvider" --tag="lang"
Lint your code with Laravel Pint using:
composer run-script lint
This package is under GNU Affero General Public License v3 or (at your option) any later version.