From 228df54e339192f72cb8018c4f208bfce436ab04 Mon Sep 17 00:00:00 2001 From: Anastas Mironov Date: Mon, 11 Nov 2024 12:11:28 +0700 Subject: [PATCH] feat: add image optimizer --- composer.json | 1 + src/UI/Filament/Resources/ArticleResource.php | 1 + 2 files changed, 2 insertions(+) diff --git a/composer.json b/composer.json index 66d10c0..f405370 100644 --- a/composer.json +++ b/composer.json @@ -25,6 +25,7 @@ "illuminate/contracts": "^10.0|^11.0", "ibecsystems/admin-kit-core": "^3.5", "ibecsystems/admin-kit-seo": "^3.4", + "joshembling/image-optimizer": "^1.4", "spatie/laravel-package-tools": "^1.14.0", "spatie/laravel-data": "^4.5", "spatie/laravel-json-api-paginate": "^1.13", diff --git a/src/UI/Filament/Resources/ArticleResource.php b/src/UI/Filament/Resources/ArticleResource.php index f646c31..a79b40b 100644 --- a/src/UI/Filament/Resources/ArticleResource.php +++ b/src/UI/Filament/Resources/ArticleResource.php @@ -43,6 +43,7 @@ public static function form(Form $form): Form $components[] = Forms\Components\SpatieMediaLibraryFileUpload::make('image') ->label(__('admin-kit-articles::articles.resource.image')) ->image() + ->optimize('webp') ->required() ->columnSpan(2)