user()?->hasAnyRole(['super_admin', 'ketua', 'auditor']) ? 'Artikel' : 'Artikel Saya'; } // Scope: ketua/super_admin/auditor lihat semua, lainnya hanya milik sendiri public static function getEloquentQuery(): Builder { $query = parent::getEloquentQuery(); if (auth()->user()?->hasAnyRole(['super_admin', 'ketua', 'auditor'])) { 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'), ]; } }