Andrew il y a 2 mois
Parent
révision
2a33adb115

+ 2
- 3
app/Filament/Resources/AlbumResource.php Voir le fichier

@@ -50,7 +50,7 @@ class AlbumResource extends Resource
50 50
                             ->required()
51 51
                             ->columnSpan(1)
52 52
                             ->native(false)
53
-                            ->Live(),
53
+                            ->live(),
54 54
                     ])->columnSpanFull()->columns(2),
55 55
                     Group::make()->schema([
56 56
                         DatePicker::make('post_date')
@@ -84,7 +84,7 @@ class AlbumResource extends Resource
84 84
                         Radio::make('upload_type')->label('')->options([
85 85
                             1 => '網址',
86 86
                             2 => '檔案',
87
-                        ])->columnSpanFull()->default(1)->Live(),
87
+                        ])->columnSpanFull()->default(1)->live(),
88 88
                         Group::make()->schema([
89 89
                             TextInput::make('link_video')->label('網址')->nullable(),
90 90
                         ])->visible(fn (Get $get): bool => $get('upload_type') == 1)->columnSpanFull(),
@@ -171,7 +171,6 @@ class AlbumResource extends Resource
171 171
                     Tables\Actions\DeleteBulkAction::make(),
172 172
                 ]),
173 173
             ])
174
-            ->defaultSort('order', 'desc')
175 174
             ->defaultSort('created_at', 'desc');
176 175
     }
177 176
 

+ 28
- 0
database/migrations/2025_11_29_063946_remove_seo_columns_from_albums_table.php Voir le fichier

@@ -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
+    public function up()
10
+    {
11
+        Schema::table('albums', function (Blueprint $table) {
12
+            $table->dropColumn([
13
+                'meta_img',
14
+                'meta_title',
15
+                'meta_description'
16
+            ]);
17
+        });
18
+    }
19
+
20
+    public function down()
21
+    {
22
+        Schema::table('albums', function (Blueprint $table) {
23
+            $table->string('meta_img')->nullable()->comment('seo image');
24
+            $table->string('meta_title')->comment('seo title');
25
+            $table->string('meta_description')->comment('seo description');
26
+        });
27
+    }
28
+};