Andrew 2 месяцев назад
Родитель
Сommit
2a33adb115

+ 2
- 3
app/Filament/Resources/AlbumResource.php Просмотреть файл

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

+ 28
- 0
database/migrations/2025_11_29_063946_remove_seo_columns_from_albums_table.php Просмотреть файл

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
+};