File tree Expand file tree Collapse file tree 4 files changed +53
-7
lines changed
Expand file tree Collapse file tree 4 files changed +53
-7
lines changed Original file line number Diff line number Diff line change 55use Illuminate \Database \Eloquent \Model ;
66use Illuminate \Support \Facades \Auth ;
77use Illuminate \Support \Facades \Storage ;
8- use Intervention \Image \Facades \Image ;
8+ use Intervention \Image \Laravel \ Facades \Image ;
99
1010class DokumentasiKegiatan extends Model
1111{
@@ -28,8 +28,8 @@ protected static function booted(): void
2828 if ($ dokumentasi ->isDirty ('file ' ) && ! empty ($ dokumentasi ->file ) && ! $ dokumentasi ->uncompress ) {
2929 $ files = array_diff ($ dokumentasi ->file , $ dokumentasi ->getOriginal ('file ' ) ?? []);
3030 foreach ($ files as $ file ) {
31- $ image = Image::make (Storage::disk ('dokumentasi ' )->path ($ file ))
32- ->encode ( ' webp ' , 50 );
31+ $ image = Image::read (Storage::disk ('dokumentasi ' )->path ($ file ))
32+ ->toWebp ( 50 );
3333 Storage::disk ('dokumentasi ' )->put ($ file , (string ) $ image );
3434 }
3535 }
Original file line number Diff line number Diff line change 66use Illuminate \Database \Eloquent \Relations \BelongsTo ;
77use Illuminate \Support \Facades \Auth ;
88use Illuminate \Support \Facades \Storage ;
9- use Intervention \Image \Facades \Image ;
9+ use Intervention \Image \Laravel \ Facades \Image ;
1010
1111class IzinKeluar extends Model
1212{
@@ -35,8 +35,8 @@ protected static function booted(): void
3535 if ($ izin ->isDirty ('bukti ' ) && $ izin ->bukti ) {
3636 $ files = array_diff ($ izin ->bukti , $ izin ->getOriginal ('bukti ' ) ?? []);
3737 foreach ($ files as $ file ) {
38- $ image = Image::make (Storage::disk ('izin_keluar ' )->path ($ file ))
39- ->encode ( ' webp ' , 50 );
38+ $ image = Image::read (Storage::disk ('izin_keluar ' )->path ($ file ))
39+ ->toWebp ( 50 );
4040 Storage::disk ('izin_keluar ' )->put ($ file , (string ) $ image );
4141 }
4242 }
Original file line number Diff line number Diff line change 1212 ],
1313 "require" : {
1414 "php" : " ^8.2" ,
15- "intervention/image" : " ^2.0 " ,
15+ "intervention/image-laravel " : " * " ,
1616 "laravel/framework" : " ^11.9" ,
1717 "laravel/nova" : " ^5.0" ,
1818 "laravel/tinker" : " ^2.9" ,
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ return [
4+
5+ /*
6+ |--------------------------------------------------------------------------
7+ | Image Driver
8+ |--------------------------------------------------------------------------
9+ |
10+ | Intervention Image supports “GD Library” and “Imagick” to process images
11+ | internally. Depending on your PHP setup, you can choose one of them.
12+ |
13+ | Included options:
14+ | - \Intervention\Image\Drivers\Gd\Driver::class
15+ | - \Intervention\Image\Drivers\Imagick\Driver::class
16+ |
17+ */
18+
19+ 'driver ' => \Intervention \Image \Drivers \Imagick \Driver::class,
20+
21+ /*
22+ |--------------------------------------------------------------------------
23+ | Configuration Options
24+ |--------------------------------------------------------------------------
25+ |
26+ | These options control the behavior of Intervention Image.
27+ |
28+ | - "autoOrientation" controls whether an imported image should be
29+ | automatically rotated according to any existing Exif data.
30+ |
31+ | - "decodeAnimation" decides whether a possibly animated image is
32+ | decoded as such or whether the animation is discarded.
33+ |
34+ | - "blendingColor" Defines the default blending color.
35+ |
36+ | - "strip" controls if meta data like exif tags should be removed when
37+ | encoding images.
38+ */
39+
40+ 'options ' => [
41+ 'autoOrientation ' => true ,
42+ 'decodeAnimation ' => true ,
43+ 'blendingColor ' => 'ffffff ' ,
44+ 'strip ' => false ,
45+ ]
46+ ];
You can’t perform that action at this time.
0 commit comments