Browse Source

260226 新增圖片上傳提示字

OMEGA\lulufj.ho 1 month ago
parent
commit
34f78cc8dd
2 changed files with 10 additions and 0 deletions
  1. 4
    0
      app/Filament/Resources/EsgResource.php
  2. 6
    0
      app/Filament/Resources/NewsResource.php

+ 4
- 0
app/Filament/Resources/EsgResource.php View File

@@ -75,6 +75,7 @@ class EsgResource extends Resource
75 75
                     Tab::make('Banner 設定')->schema([
76 76
                         FileUpload::make('banner_pc')->label("Banner (PC)")
77 77
                         ->disk("public")
78
+                        ->helperText('檔案大小限制為1MB以下')
78 79
                         // ->helperText('建議寬高限制為:1280*720px,檔案大小限制為1M以下')->maxSize('1024')
79 80
                         ->directory("esg")->required()
80 81
                         ->validationMessages([
@@ -82,6 +83,7 @@ class EsgResource extends Resource
82 83
                         ]),
83 84
                         FileUpload::make('banner_mobile')->label("Banner (Mobile)")
84 85
                         ->disk("public")
86
+                        ->helperText('檔案大小限制為1MB以下')
85 87
                         // ->helperText('建議寬高限制為:600*896px,檔案大小限制為1M以下')->maxSize('1024')
86 88
                         ->directory("esg")->required()
87 89
                         ->validationMessages([
@@ -409,6 +411,7 @@ class EsgResource extends Resource
409 411
                                         ])->locales(["zh_TW", "en"])
410 412
                                         ->id(fn ($get) => "para_img_mul_" . $get('para_img_item_key')),
411 413
                                         FileUpload::make('image_url')->label("")->disk("public")
414
+                                        ->helperText('檔案大小限制為1MB以下')
412 415
                                         // ->helperText('建議寬高限制為:1080*675px,檔案大小限制為1M以下')->maxSize('1024')
413 416
                                         ->directory("esg/paragraphPhoto")
414 417
                                         ->maxFiles(10)
@@ -426,6 +429,7 @@ class EsgResource extends Resource
426 429
                                 Section::make("")->schema([
427 430
                                     FileUpload::make('content.video_img')->label("影片底圖")
428 431
                                     ->disk("public")
432
+                                    ->helperText('檔案大小限制為1MB以下')
429 433
                                     ->directory("esg/paragraphVideo"),
430 434
                                     TextInput::make('content.link')->label("網址")->required()
431 435
                                     ->validationMessages([

+ 6
- 0
app/Filament/Resources/NewsResource.php View File

@@ -84,10 +84,12 @@ class NewsResource extends Resource
84 84
                     ])->columnSpanFull()->columns(3),
85 85
                     FileUpload::make('news_img_pc')->label("列表圖(desktop)")
86 86
                     ->disk("public")
87
+                    ->helperText('檔案大小限制為1MB以下')
87 88
                     // ->helperText('建議寬高限制為:1280*720px,檔案大小限制為1M以下')->maxSize('1024')
88 89
                     ->directory("news"),
89 90
                     FileUpload::make('news_img_mobile')->label("列表圖(mobile)")
90 91
                     ->disk("public")
92
+                    ->helperText('檔案大小限制為1MB以下')
91 93
                     // ->helperText('建議寬高限制為:600*896px,檔案大小限制為1M以下')->maxSize('1024')
92 94
                     ->directory("news"),
93 95
                     Translate::make()->schema(fn (string $locale) => [
@@ -163,6 +165,7 @@ class NewsResource extends Resource
163 165
                     ->locales(["zh_TW", "en"])
164 166
                     ->id("seo"),
165 167
                     FileUpload::make('meta_img')->label("放大預覽圖")->disk("public")
168
+                    ->helperText('檔案大小限制為1MB以下')
166 169
                     // ->helperText('建議寬高限制為:1200*630px,檔案大小限制為1M以下')->maxSize('1024')
167 170
                     ->directory("seo/news"),
168 171
                 ])->columnSpanFull(),
@@ -197,6 +200,7 @@ class NewsResource extends Resource
197 200
                                     ])->locales(["zh_TW", "en"])
198 201
                                     ->id(fn ($get) => "para_img_mul_" . $get('para_img_item_key')),
199 202
                                     FileUpload::make('image_url')->label("")->disk("public")
203
+                                    ->helperText('檔案大小限制為1MB以下')
200 204
                                     // ->helperText('建議寬高限制為:1080*675px,檔案大小限制為1M以下')->maxSize('1024')
201 205
                                     ->directory("news/extraPhoto")
202 206
                                     ->maxFiles(10),
@@ -239,6 +243,7 @@ class NewsResource extends Resource
239 243
                                 Section::make("")->schema([
240 244
                                     FileUpload::make('video_img')->label("影片底圖")
241 245
                                     ->disk("public")
246
+                                    ->helperText('檔案大小限制為1MB以下')
242 247
                                     ->directory("news/paragraph/video"),
243 248
                                     // ->helperText('建議寬高限制為:2000*720px,出血寬度720px,主要圖像範圍為:1280*720px,檔案大小限制為1M以下')->maxSize('1024'),
244 249
                                     Translate::make()->schema(fn (string $locale) => [
@@ -254,6 +259,7 @@ class NewsResource extends Resource
254 259
                                     ])->visible(fn (Get $get):bool => $get("video_type") == 1)->columnSpanFull(),
255 260
                                     Group::make()->schema([
256 261
                                         FileUpload::make('video_url')->label("")->disk("public")->directory("news/paragraph/video")
262
+                                        ->helperText('檔案大小限制為100MB以下')
257 263
                                         // ->helperText('建議影片寬高限制為:1920*1080px,出血寬度720px,大小限制為:100M以下')
258 264
                                         // ->maxSize(102400)
259 265
                                         ->nullable(),