public static function getEloquentQuery(): Builder
{
if (isAdmin()) {
$query = parent::getEloquentQuery()
->withoutGlobalScopes([
SoftDeletingScope::class,
]);
} else {
$query = parent::getEloquentQuery()->whereBelongsTo(auth()->user(), 'employee')
->withoutGlobalScopes([
SoftDeletingScope::class,
]);
return $query;
}
protected static function getNavigationBadge(): ?string
{
return parent::getEloquentQuery()->where('is_processed', 0)->count();
}
public static function getEloquentQuery(): Builder
{
if (isAdmin()) {
$query = parent::getEloquentQuery()
->withoutGlobalScopes([
SoftDeletingScope::class,
]);
} else {
$query = parent::getEloquentQuery()->whereBelongsTo(auth()->user(), 'employee')
->withoutGlobalScopes([
SoftDeletingScope::class,
]);
return $query;
}
protected static function getNavigationBadge(): ?string
{
return parent::getEloquentQuery()->where('is_processed', 0)->count();
}