searchable(), Column::make('Judul', 'title')->searchable(), Column::make('Status', 'status') ->format( fn ($value) => Blade::render(''.$value->label().'') ) ->html(), Column::make('Waktu Publish', 'published_at') ->format(fn ($value) => formatDateTime($value)) ->searchable(), Column::make('Aksi') ->label(function ($row) { $actions = ''; if (auth()->user()->can('update article')) { $actions .= view('components.datatables.edit', [ 'id' => $row->hash, 'editRoute' => route('studio.manage.article.edit', $row->hash), ])->render(); } if (auth()->user()->can('delete article')) { $actions .= view('components.datatables.delete', [ 'id' => $row->hash, 'deleteRoute' => route('studio.manage.article.delete', $row->hash), ])->render(); } return $actions; }) ->html() ->hideIf(auth()->user()->cannot('update artcile') && auth()->user()->cannot('delete artcile')), ]; } public function builder(): Builder { return Article::select('articles.id', 'title', 'articles.status')->with(['author', 'author.employee']); } }