user()?->can('ViewAny:Post') && auth()->user()?->can('Update:Post') ? 'Artikel' : 'Artikel Saya'; } public static function getEloquentQuery(): Builder { $query = parent::getEloquentQuery(); if (auth()->user()?->can('Update:Post')) { return $query; } return $query->where('author_id', auth()->id()); } public static function form(Schema $form): Schema { return PostForm::configure($form); } public static function table(Table $table): Table { return PostsTable::configure($table); } public static function getPages(): array { return [ 'index' => ListPosts::route('/'), 'create' => CreatePost::route('/create'), 'edit' => EditPost::route('/{record}/edit'), ]; } }