route('course-create'); } protected function getTableQuery() { if (Auth::user()->isRole('admin')) { return Course::query(); } return Course::query()->where('user_id', Auth::id()); } protected function getTableColumns(): array { return [ TextColumn::make('name')->label('Название'), ]; } protected function getTableActions(): array { return [ Action::make('edit')->label('Редактировать') ->url(fn (Course $record): string => route('course-edit', [ 'course' => $record ])), Action::make('delete')->label('Удалить')->color('danger') ->action(function (Course $record) { return $record->delete(); }), ]; } public function render() { return view('livewire.course.course-manage')->layout('layouts.simple-page'); } }