Action Preview plugin screenshot
Dark mode ready
Multilingual support
Supports v5.x

Action Preview

Community

Action to preview a resource before saving or publishing it.

Tags: Action Panels
Supported versions:
5.x 4.x
Novius avatar Author: Novius

Package health

Beta

Automated checks of this plugin's Composer package

70 / 100
Security 52
Maintenance 90
Ecosystem 100
15 checks
Third-party plugin. This is built by the community, not the Filament team. Filament does not review, endorse, or vet the security of plugins outside the filament/ namespace. Review the source and install at your own risk. Found malware or an unresolved security issue the author won't address? Report it .
Powered by Plumb Last scanned 3 days ago

Documentation

Packagist Release License: AGPL v3

#Introduction

This package allows you to add Laravel Filament action to open the front preview url of a ressource.

#Requirements

  • Laravel Filament >= 4
  • Laravel >= 11.0
  • Laravel >= 8.2

#Installation

You can install the package via composer:

composer require novius/laravel-filament-action-preview

#Usage

This package provides the following action:

  • \Novius\LaravelFilamentActionPreview\Filament\Actions\PreviewAction

#If the model have a previewUrl method :

use Filament\Resources\Resource;
use Novius\LaravelFilamentActionPreview\Filament\Actions\PreviewAction;

class Post extends Resource
{
    public static function table(Table $table): Table
    {
        return $table
            ->actions([
                PreviewAction::make(),
            ]);
    }

#Otherwise, you must specify the preview url :

use App\Models\Post as PostModel;
use Filament\Resources\Resource;
use Novius\LaravelFilamentActionPreview\Filament\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]);
                    }),
            ]);
    }

#Lang files

If you want to customize the lang files, you can publish them with:

php artisan vendor:publish --provider="Novius\LaravelFilamentActionPreview\LaravelFilamentActionPreviewServiceProvider" --tag="lang"

#Lint

Lint your code with Laravel Pint using:

composer run-script lint

#Licence

This package is under GNU Affero General Public License v3 or (at your option) any later version.