Pros:
Intervention Image for resizing before upload).filament-croppie.php enable consistency across forms (e.g., enforcing aspect ratios, max file sizes).Cons:
create/edit methods).validateImageDimensions) must be implemented separately.hasOne relationship, base64 vs. file upload)?composer show filament/filament).composer require michaeld555/filament-croppie
php artisan filament-croppie:install # Publishes config/translations
config/filament-croppie.php for defaults (e.g., aspect_ratio, upload_url).FileUpload fields with the Croppie field:
use Michaeld555\FilamentCroppie\Fields\Croppie;
Croppie::make('avatar')
->image()
->required()
->aspectRatio(1, 1) // Square crop
->uploadUrl(fn ($record) => route('admin.images.store'));
upload_url must point to a Laravel route handling the cropped image (e.g., using CroppieController or a custom endpoint).public function storeCroppedImage(Request $request) {
$request->validate(['image' => 'required|image']);
$path = $request->file('image')->store('cropped');
// Process further (e.g., generate thumbnails)
return response()->json(['path' => $path]);
}
spatie/laravel-filament-settings). Test in staging.Croppie and test thoroughly.michaeld555/filament-croppie and filament/filament for breaking changes.config/filament-croppie.php periodically for outdated defaults.upload_url is accessible via AJAX (e.g., no auth middleware if testing locally).store() logic in the backend (e.g., disk space, permissions).tailwind or blade directives to scope Croppie’s CSS.debug mode (php artisan filament:debug).asset() helper to scope assets to specific panels.How can I help you explore Laravel packages today?