src/Models/User.php
public function scopeProtectAdmins(Builder $query)
    {
        /** @var  self  $user */
        $user = auth()->user();

        return ($user && $user->is_admin)
            ? $query
            : $query->where('is_admin', false);
    }
public function scopeProtectAdmins(Builder $query)
    {
        /** @var  self  $user */
        $user = auth()->user();

        return ($user && $user->is_admin)
            ? $query
            : $query->where('is_admin', false);
    }
public function scopeProtectAdmins ( Builder $ query ) { /** @var  self  $user */ $ user = auth ( ) -> user ( ) ; return ( $ user && $ user -> is_admin ) ? $ query : $ query -> where ( 'is_admin' , false ) ; }
Protect admins.

@param  \Illuminate\Database\Eloquent\Builder  $query

@return \Illuminate\Database\Eloquent\Builder
Protect admins .