src/Models/Role.php
public function addUser($user)
    {
        if (!$this->hasUser($user)) {
            return RoleUser::create(['role_id' => $this->id, 'user_id' => $user->id]);
        }

        return false;
    }
public function addUser($user)
    {
        if (!$this->hasUser($user)) {
            return RoleUser::create(['role_id' => $this->id, 'user_id' => $user->id]);
        }

        return false;
    }
public function addUser ( $ user ) { if ( ! $ this -> hasUser ( $ user ) ) { return RoleUser :: create ( [ 'role_id' => $ this -> id , 'user_id' => $ user -> id ] ) ; } return false ; }
Adds a user into the role.

@param mixed $user
Adds a user into the role .