hasRole(RoleEnum::PERUSAHAAN)) { return null; } return static::getModel()::pending()->count(); } public static function infolist(Schema $schema): Schema { return DataChangeInfolist::configure($schema); } public static function table(Table $table): Table { return DataChangeTable::configure($table); } public static function getEloquentQuery(): Builder { return parent::getEloquentQuery() ->when(Auth::user()?->hasRole(RoleEnum::PERUSAHAAN->value), function (Builder $q): Builder { return $q->where('user_id', Auth::id()); }); } public static function getPages(): array { return [ 'index' => ManageDataChanges::route('/'), 'view' => ViewDataChange::route('/{record}'), ]; } }