Browse Source

alter upload_files title

Andrew 2 months ago
parent
commit
307ce59e7b

+ 2
- 1
app/Filament/Resources/UploadFileResource.php View File

@@ -43,8 +43,9 @@ class UploadFileResource extends Resource
43 43
                         ])
44 44
                             ->locales(["zh_TW", "en"])
45 45
                             ->actions([
46
-                                app(DeepLService::class)->createTranslationAction("Main", ["title"])
46
+                                app(DeepLService::class)->createTranslationAction("UploadFile", ["title"])
47 47
                             ])->columnSpanFull(),
48
+                        TextInput::make('title')->required()->label('標題'),
48 49
                         Radio::make('type')->label('類型')->options([1 => '社會公益'])->default(1),
49 50
                         Group::make()->schema([
50 51
                             FileUpload::make('upload_link')->label('上傳檔案')->directory('uploadFiles')->columnSpan(1),

+ 28
- 0
database/migrations/2025_11_26_072601_alter_upload_files_table.php View File

@@ -0,0 +1,28 @@
1
+<?php
2
+
3
+use Illuminate\Database\Migrations\Migration;
4
+use Illuminate\Database\Schema\Blueprint;
5
+use Illuminate\Support\Facades\Schema;
6
+
7
+return new class extends Migration
8
+{
9
+    /**
10
+     * Run the migrations.
11
+     */
12
+    public function up(): void
13
+    {
14
+        Schema::table('upload_files', function (Blueprint $table) {
15
+            $table->json('title')->nullable()->comment('標題');
16
+        });
17
+    }
18
+
19
+    /**
20
+     * Reverse the migrations.
21
+     */
22
+    public function down(): void
23
+    {
24
+        Schema::table('upload_files', function (Blueprint $table) {
25
+            $table->string('title')->nullable()->comment('標題')->change();
26
+        });
27
+    }
28
+};