Skip to content

Commit

Permalink
feat: add image optimizer
Browse files Browse the repository at this point in the history
  • Loading branch information
daurensky committed Mar 19, 2024
1 parent 9ad6bbd commit 598a9ce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"spatie/laravel-data": "^3.2",
"spatie/laravel-json-api-paginate": "^1.13",
"spatie/laravel-query-builder": "^5.7",
"spatie/laravel-translatable": "^6.5"
"spatie/laravel-translatable": "^6.5",
"joshembling/image-optimizer": "^1.4"
},
"require-dev": {
"laravel/pint": "^1.0",
Expand Down
5 changes: 4 additions & 1 deletion src/UI/Filament/Resources/SocialProjectResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ public static function form(Forms\Form $form): Forms\Form
Forms\Components\SpatieMediaLibraryFileUpload::make('image.'.$locale)
->collection('image.'.$locale)
->label(__('admin-kit-social-projects::social-projects.resource.image'))
->required(),
->required()
->image()
->optimize('webp')
->resize(30),
Forms\Components\TextInput::make('title.'.$locale)
->label(__('admin-kit-social-projects::social-projects.resource.title'))
->required(),
Expand Down

0 comments on commit 598a9ce

Please sign in to comment.