The expression return App\Models\User::....id', Auth::user()->id) could return the type Illuminate\Database\Query\Builder which is incompatible with the type-hinted return Illuminate\Database\Eloquent\Builder. Consider adding an additional type-check to rule them out.
Loading history...
18
users.id, user_groups.name as userGroup, people.name, people.appellative,
19
people.phone, users.email, roles.name as role, users.is_active,
Accessing id on the interface Illuminate\Contracts\Auth\Authenticatable suggest that you code against a concrete implementation. How about adding an instanceof check?