소스 검색

image optimize:

Andrew 1 개월 전
부모
커밋
a1fdb2df47
3개의 변경된 파일164개의 추가작업 그리고 1개의 파일을 삭제
  1. 2
    0
      app/Filament/Resources/AlbumResource.php
  2. 1
    0
      composer.json
  3. 161
    1
      composer.lock

+ 2
- 0
app/Filament/Resources/AlbumResource.php 파일 보기

@@ -58,6 +58,8 @@ class AlbumResource extends Resource
58 58
                             ->closeOnDateSelection(),
59 59
                     ])->columnSpanFull()->columns(2),
60 60
                     FileUpload::make('news_banner')->label('列表大圖')
61
+                        ->image()
62
+                        ->optimize('webp')
61 63
                         ->directory('album/img')
62 64
                         ->acceptedFileTypes(['image/jpeg', 'image/jpg', 'image/png', 'image/webp'])->required()->imageEditor(),
63 65
                     FileUpload::make('news_img_pc')->label('列表圖(desktop)')

+ 1
- 0
composer.json 파일 보기

@@ -13,6 +13,7 @@
13 13
         "deeplcom/deepl-php": "^1.12",
14 14
         "filament/filament": "^3.3",
15 15
         "filament/spatie-laravel-translatable-plugin": "^3.3",
16
+        "joshembling/image-optimizer": "^1.6",
16 17
         "laravel/framework": "^12.0",
17 18
         "laravel/sanctum": "^4.0",
18 19
         "laravel/tinker": "^2.10.1",

+ 161
- 1
composer.lock 파일 보기

@@ -4,7 +4,7 @@
4 4
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
5 5
         "This file is @generated automatically"
6 6
     ],
7
-    "content-hash": "0217f8c486e15b4b4c89da20e85b6673",
7
+    "content-hash": "bb2977a24f3e7e48919beecc670f668d",
8 8
     "packages": [
9 9
         {
10 10
             "name": "abdulmajeed-jamaan/filament-translatable-tabs",
@@ -2481,6 +2481,166 @@
2481 2481
             "time": "2025-08-22T14:27:06+00:00"
2482 2482
         },
2483 2483
         {
2484
+            "name": "intervention/image",
2485
+            "version": "2.7.2",
2486
+            "source": {
2487
+                "type": "git",
2488
+                "url": "https://github.com/Intervention/image.git",
2489
+                "reference": "04be355f8d6734c826045d02a1079ad658322dad"
2490
+            },
2491
+            "dist": {
2492
+                "type": "zip",
2493
+                "url": "https://api.github.com/repos/Intervention/image/zipball/04be355f8d6734c826045d02a1079ad658322dad",
2494
+                "reference": "04be355f8d6734c826045d02a1079ad658322dad",
2495
+                "shasum": ""
2496
+            },
2497
+            "require": {
2498
+                "ext-fileinfo": "*",
2499
+                "guzzlehttp/psr7": "~1.1 || ^2.0",
2500
+                "php": ">=5.4.0"
2501
+            },
2502
+            "require-dev": {
2503
+                "mockery/mockery": "~0.9.2",
2504
+                "phpunit/phpunit": "^4.8 || ^5.7 || ^7.5.15"
2505
+            },
2506
+            "suggest": {
2507
+                "ext-gd": "to use GD library based image processing.",
2508
+                "ext-imagick": "to use Imagick based image processing.",
2509
+                "intervention/imagecache": "Caching extension for the Intervention Image library"
2510
+            },
2511
+            "type": "library",
2512
+            "extra": {
2513
+                "laravel": {
2514
+                    "aliases": {
2515
+                        "Image": "Intervention\\Image\\Facades\\Image"
2516
+                    },
2517
+                    "providers": [
2518
+                        "Intervention\\Image\\ImageServiceProvider"
2519
+                    ]
2520
+                },
2521
+                "branch-alias": {
2522
+                    "dev-master": "2.4-dev"
2523
+                }
2524
+            },
2525
+            "autoload": {
2526
+                "psr-4": {
2527
+                    "Intervention\\Image\\": "src/Intervention/Image"
2528
+                }
2529
+            },
2530
+            "notification-url": "https://packagist.org/downloads/",
2531
+            "license": [
2532
+                "MIT"
2533
+            ],
2534
+            "authors": [
2535
+                {
2536
+                    "name": "Oliver Vogel",
2537
+                    "email": "oliver@intervention.io",
2538
+                    "homepage": "https://intervention.io/"
2539
+                }
2540
+            ],
2541
+            "description": "Image handling and manipulation library with support for Laravel integration",
2542
+            "homepage": "http://image.intervention.io/",
2543
+            "keywords": [
2544
+                "gd",
2545
+                "image",
2546
+                "imagick",
2547
+                "laravel",
2548
+                "thumbnail",
2549
+                "watermark"
2550
+            ],
2551
+            "support": {
2552
+                "issues": "https://github.com/Intervention/image/issues",
2553
+                "source": "https://github.com/Intervention/image/tree/2.7.2"
2554
+            },
2555
+            "funding": [
2556
+                {
2557
+                    "url": "https://paypal.me/interventionio",
2558
+                    "type": "custom"
2559
+                },
2560
+                {
2561
+                    "url": "https://github.com/Intervention",
2562
+                    "type": "github"
2563
+                }
2564
+            ],
2565
+            "time": "2022-05-21T17:30:32+00:00"
2566
+        },
2567
+        {
2568
+            "name": "joshembling/image-optimizer",
2569
+            "version": "v1.6.4",
2570
+            "source": {
2571
+                "type": "git",
2572
+                "url": "https://github.com/joshembling/image-optimizer.git",
2573
+                "reference": "0b1e3f9ba3de9b448efa53c3a8499c0e2ec843bb"
2574
+            },
2575
+            "dist": {
2576
+                "type": "zip",
2577
+                "url": "https://api.github.com/repos/joshembling/image-optimizer/zipball/0b1e3f9ba3de9b448efa53c3a8499c0e2ec843bb",
2578
+                "reference": "0b1e3f9ba3de9b448efa53c3a8499c0e2ec843bb",
2579
+                "shasum": ""
2580
+            },
2581
+            "require": {
2582
+                "filament/forms": "^3.3",
2583
+                "illuminate/contracts": "^10.0|^11.0|^12.0",
2584
+                "intervention/image": "^2.7",
2585
+                "php": "^8.2",
2586
+                "spatie/laravel-package-tools": "^1.19.0"
2587
+            },
2588
+            "require-dev": {
2589
+                "laravel/pint": "^1.0",
2590
+                "nunomaduro/collision": "^7.9",
2591
+                "orchestra/testbench": "^8.0"
2592
+            },
2593
+            "type": "library",
2594
+            "extra": {
2595
+                "laravel": {
2596
+                    "aliases": {
2597
+                        "ImageOptimizer": "Joshembling\\ImageOptimizer\\Facades\\ImageOptimizer"
2598
+                    },
2599
+                    "providers": [
2600
+                        "Joshembling\\ImageOptimizer\\ImageOptimizerServiceProvider"
2601
+                    ]
2602
+                }
2603
+            },
2604
+            "autoload": {
2605
+                "psr-4": {
2606
+                    "Joshembling\\ImageOptimizer\\": "src/"
2607
+                }
2608
+            },
2609
+            "notification-url": "https://packagist.org/downloads/",
2610
+            "license": [
2611
+                "MIT"
2612
+            ],
2613
+            "authors": [
2614
+                {
2615
+                    "name": "Josh Embling",
2616
+                    "email": "joshembling@gmail.com",
2617
+                    "role": "Developer"
2618
+                }
2619
+            ],
2620
+            "description": "Optimize your Filament images before they reach your database.",
2621
+            "homepage": "https://github.com/joshembling/image-optimizer",
2622
+            "keywords": [
2623
+                "filament",
2624
+                "filamentphp",
2625
+                "image",
2626
+                "image-optimizer",
2627
+                "joshembling",
2628
+                "laravel",
2629
+                "optimization"
2630
+            ],
2631
+            "support": {
2632
+                "issues": "https://github.com/joshembling/image-optimizer/issues",
2633
+                "source": "https://github.com/joshembling/image-optimizer"
2634
+            },
2635
+            "funding": [
2636
+                {
2637
+                    "url": "https://github.com/joshembling",
2638
+                    "type": "github"
2639
+                }
2640
+            ],
2641
+            "time": "2025-10-19T21:18:50+00:00"
2642
+        },
2643
+        {
2484 2644
             "name": "kirschbaum-development/eloquent-power-joins",
2485 2645
             "version": "4.2.8",
2486 2646
             "source": {