public function assignPermission($permissionId = null)
    {
        $permissions = $this->permissions;

        if (! $permissions->contains($permissionId)) {
            $this->permissions()->attach($permissionId);

            return true;
        }

        return false;
    }
public function assignPermission($permissionId = null)
    {
        $permissions = $this->permissions;

        if (! $permissions->contains($permissionId)) {
            $this->permissions()->attach($permissionId);

            return true;
        }

        return false;
    }
public function assignPermission ( $ permissionId = null ) { $ permissions = $ this -> permissions ; if ( ! $ permissions -> contains ( $ permissionId ) ) { $ this -> permissions ( ) -> attach ( $ permissionId ) ; return true ; } return false ; }
Assigns the given permission to the role.

@param  int $permissionId
@return bool
Assigns the given permission to the role .