doubt with getEloquentQuery

I have a resource with the following getEloquentQuery:

if (isAdmin() || isSuperAdmin()) {
    $query = parent::getEloquentQuery()
        ->withoutGlobalScopes([
            SoftDeletingScope::class,
        ]);
} else {
    $query = parent::getEloquentQuery()
        ->whereHas('customer.applicants', function ($q) {
            $q->where('user_id', auth()->user()->id)->vip();
        })
        ->orwhereBelongsTo(auth()->user(), 'requestedBy')
        ->withoutGlobalScopes([
            SoftDeletingScope::class,
        ]);

\Log::info(auth()->user()->id);
\Log::info($query->toRawSql());

return $query;


In the table I see everything correct, but if I enter any of them in view/edit it always shows me the same record in all of them.

Am I missing something?

Thanks
Was this page helpful?