public function isApiEnabledForUser(User $user)
    {
        $roles = $user->roles->pluck('id')->toArray();
        return !count($roles) ? false : $this->newQuery()->whereIn('role_id', array_values($roles))->where('enabled', 1)->get()->count() > 0;
    }
public function isApiEnabledForUser(User $user)
    {
        $roles = $user->roles->pluck('id')->toArray();
        return !count($roles) ? false : $this->newQuery()->whereIn('role_id', array_values($roles))->where('enabled', 1)->get()->count() > 0;
    }
public function isApiEnabledForUser ( User $ user ) { $ roles = $ user -> roles -> pluck ( 'id' ) -> toArray ( ) ; return ! count ( $ roles ) ? false : $ this -> newQuery ( ) -> whereIn ( 'role_id' , array_values ( $ roles ) ) -> where ( 'enabled' , 1 ) -> get ( ) -> count ( ) > 0 ; }
whether user role has enabled api support

@param User $user
@return boolean
whether user role has enabled api support