refactor: Remove sort_order column and related reordering functionality from categories, departments, and themes.
This commit is contained in:
parent
a2adfbb53d
commit
3eb3bd697c
@ -43,7 +43,6 @@ public function handle()
|
||||
'name' => $legacy->name,
|
||||
'alias' => Str::limit($legacy->name, 20, ''),
|
||||
'is_active' => IsActive::ACTIVE->value,
|
||||
'sort_order' => 0,
|
||||
'created_at' => $legacy->created_at ?? now(),
|
||||
'updated_at' => $legacy->updated_at ?? now(),
|
||||
'deleted_at' => $legacy->deleted_at,
|
||||
|
||||
@ -46,7 +46,6 @@ public function handle()
|
||||
[
|
||||
'name' => $legacy->name,
|
||||
'is_active' => IsActive::ACTIVE->value,
|
||||
'sort_order' => 0,
|
||||
'created_at' => $legacy->created_at ?? now(),
|
||||
'updated_at' => $legacy->updated_at ?? now(),
|
||||
'deleted_at' => $legacy->deleted_at,
|
||||
|
||||
@ -104,8 +104,7 @@ public static function table(Table $table): Table
|
||||
->emptyStateIcon(Heroicon::ListBullet)
|
||||
->emptyStateDescription('Setelah Anda membubat data pertama, maka akan muncul disini.')
|
||||
->defaultSort('created_at', 'desc')
|
||||
->deferFilters(false)
|
||||
->reorderable('sort_order');
|
||||
->deferFilters(false);
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
|
||||
@ -114,8 +114,7 @@ public static function table(Table $table): Table
|
||||
->emptyStateIcon(Heroicon::BuildingLibrary)
|
||||
->emptyStateDescription('Setelah Anda membubat data pertama, maka akan muncul disini.')
|
||||
->defaultSort('created_at', 'desc')
|
||||
->deferFilters(false)
|
||||
->reorderable('sort_order');
|
||||
->deferFilters(false);
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
|
||||
@ -104,8 +104,7 @@ public static function table(Table $table): Table
|
||||
->emptyStateIcon(Heroicon::PuzzlePiece)
|
||||
->emptyStateDescription('Setelah Anda membubat data pertama, maka akan muncul disini.')
|
||||
->defaultSort('created_at', 'desc')
|
||||
->deferFilters(false)
|
||||
->reorderable('sort_order');
|
||||
->deferFilters(false);
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
|
||||
@ -71,7 +71,7 @@ public function render()
|
||||
->withCount(['news' => function ($query) {
|
||||
$query->published();
|
||||
}])
|
||||
->orderBy('sort_order')
|
||||
->orderBy('name')
|
||||
->get();
|
||||
|
||||
$popularPosts = News::published()
|
||||
|
||||
@ -21,7 +21,6 @@ protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'is_active' => IsActive::class,
|
||||
'sort_order' => 'integer',
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@ -18,7 +18,6 @@ protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'is_active' => IsActive::class,
|
||||
'sort_order' => 'integer',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,7 +22,6 @@ protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'is_active' => IsActive::class,
|
||||
'sort_order' => 'integer',
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@ -17,7 +17,6 @@ public function up(): void
|
||||
$table->string('name', 100)->index();
|
||||
$table->string('alias', 20)->index();
|
||||
$table->enum('is_active', IsActive::values())->default(IsActive::ACTIVE->value)->comment(IsActive::comment())->index();
|
||||
$table->integer('sort_order')->default(0)->index();
|
||||
$table->timestamp('created_at')->useCurrent();
|
||||
$table->timestamp('updated_at')->nullable()->useCurrentOnUpdate();
|
||||
$table->softDeletes();
|
||||
|
||||
@ -16,7 +16,6 @@ public function up(): void
|
||||
$table->id();
|
||||
$table->string('name', 50)->index();
|
||||
$table->enum('is_active', IsActive::values())->default(IsActive::ACTIVE->value)->comment(IsActive::comment())->index();
|
||||
$table->integer('sort_order')->default(0)->index();
|
||||
$table->timestamp('created_at')->useCurrent();
|
||||
$table->timestamp('updated_at')->nullable()->useCurrentOnUpdate();
|
||||
$table->softDeletes();
|
||||
|
||||
@ -16,7 +16,6 @@ public function up(): void
|
||||
$table->id();
|
||||
$table->string('name', 50);
|
||||
$table->enum('is_active', [IsActive::values()])->default(IsActive::ACTIVE->value)->comment(IsActive::comment());
|
||||
$table->integer('sort_order')->default(0);
|
||||
$table->timestamp('created_at')->useCurrent();
|
||||
$table->timestamp('updated_at')->nullable()->useCurrentOnUpdate();
|
||||
$table->softDeletes();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user