searchable(), Column::make('Aksi') ->label(function ($row) { $actions = ''; $maxSortOrder = Brand::max('sort_order'); if ($row->sort_order > 1) { $actions .= view('components.datatables.sort-button', [ 'id' => $row->id, 'module' => 'brand', 'direction' => 'up', 'tooltip' => 'Naik', 'color' => 'cyan', 'icon' => 'arrow-up', ])->render(); $actions .= view('components.datatables.sort-button', [ 'id' => $row->id, 'module' => 'brand', 'direction' => 'first', 'tooltip' => 'Pertama', 'color' => 'emerald', 'icon' => 'bars-arrow-up', ])->render(); } if ($row->sort_order < $maxSortOrder) { $actions .= view('components.datatables.sort-button', [ 'id' => $row->id, 'module' => 'brand', 'direction' => 'down', 'tooltip' => 'Turun', 'color' => 'orange', 'icon' => 'arrow-down', ])->render(); $actions .= view('components.datatables.sort-button', [ 'id' => $row->id, 'module' => 'brand', 'direction' => 'last', 'tooltip' => 'Terakhir', 'color' => 'rose', 'icon' => 'bars-arrow-down', ])->render(); } $actions .= view('components.datatables.edit-modal', [ 'id' => $row->id, 'method' => 'update', 'modalTitle' => 'Ubah Kategori', ])->render(); $actions .= view('components.datatables.delete', [ 'id' => $row->id, 'deleteRoute' => route('studio.catalog.brand.delete', $row->id), ])->render(); return $actions; }) ->html(), ]; } public function builder(): Builder { return Brand::select('id', 'name', 'sort_order')->orderBy('sort_order'); } }