statikbe/laravel-filament-flexible-blocks-asset-manager

A simple document and image manager for the Filament Flexible Blocks package.

This package is auto-updated.

Last update: 2024-11-18 12:24:02 UTC


README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This package provides a simple document and image manager for the Laravel Filament Flexible Content Blocks package.

The key features are:

Installation

You can install the package via composer:

composer require statikbe/laravel-filament-flexible-blocks-asset-manager

You can publish and run the migrations with:

php artisan vendor:publish --tag="filament-flexible-blocks-asset-manager-migrations"
php artisan migrate

You can publish the config file with:

php artisan vendor:publish --tag="filament-flexible-blocks-asset-manager-config"

Optionally, you can publish the translations using

php artisan vendor:publish --tag="filament-flexible-blocks-asset-manager-translations"

Setup with the Filament Flexible Content Blocks package

To integrate the plugin with Filament, you need to add it a panel in the filament service provider. See the code sample below:

public function panel(Panel $panel): Panel
{
    return $panel
        ->default()
        //...
        ->plugins([
            SpatieLaravelTranslatablePlugin::make()
                ->defaultLocales(['nl']),
            //...
            FilamentFlexibleBlocksAssetManagerPlugin::make()
        ]);
}

Then to use the asset manager in the call-to-actions you have to add them to the configuration of the Filament Flexible Content Blocks package:

return [
    //...
     
    'call_to_action_models' => [
        [
            'model' => \Statikbe\FilamentFlexibleBlocksAssetManager\Models\Asset::class,
            'call_to_action_type' => \Statikbe\FilamentFlexibleBlocksAssetManager\Filament\Form\Fields\Blocks\Type\AssetCallToActionType::class,
        ],
        //...
        //\App\Models\TranslatablePage::class,
    ],
        
    //...
]

Configuration

The configuration file is filament-flexible-blocks-asset-manager.php fully commented, to explain each configuration option.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.