src/Traits/HasRoleAndPermission.php
public function checkRole($role)
    {
        return $this->getRoles()->contains(function ($value) use ($role) {
            return $role == $value->id || Str::is($role, $value->slug);
        });
    }
public function checkRole($role)
    {
        return $this->getRoles()->contains(function ($value) use ($role) {
            return $role == $value->id || Str::is($role, $value->slug);
        });
    }
public function checkRole ( $ role ) { return $ this -> getRoles ( ) -> contains ( function ( $ value ) use ( $ role ) { return $ role == $ value -> id || Str :: is ( $ role , $ value -> slug ) ; } ) ; }
Check if the user has role.

@param int|string $role

@return bool
Check if the user has role .