This package provides a simple document and image manager for the Laravel Filament Flexible Content Blocks package.
The key features are:
- a simple asset model
- integration with the call-to-action features of the Laravel Filament Flexible Content Blocks package.
- basic filament CRUD UI
- routing to retrieve the assets
| Filament Version | Package Version | Development Branch |
|---|---|---|
| v3 | statikbe/laravel-filament-flexible-blocks-asset-manager:^3.0 |
v3 |
| v4 & v5 | statikbe/laravel-filament-flexible-blocks-asset-manager:^4.0 |
main |
If you upgrade to v4.1.0, check the upgrade guide.
You can install the package via composer:
composer require statikbe/laravel-filament-flexible-blocks-asset-managerYou can publish and run the migrations with:
php artisan vendor:publish --tag="filament-flexible-blocks-asset-manager-migrations"
php artisan migrateYou 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"To enable thumbnail previews for PDF assets in the table, you need to install spatie/pdf-to-image:
composer require spatie/pdf-to-imageThis requires Imagick and Ghostscript to be installed on your server. See the spatie/pdf-to-image documentation for more details.
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,
],
//...
]The configuration file is filament-flexible-blocks-asset-manager.php fully commented, to explain each configuration option.
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.
