src/Models/Role.php
public function addPermission($permission)
    {
        if (!$this->hasPermission($permission)) {
            return PermissionRole::create(['role_id' => $this->id, 'permission_id' => $permission->id]);
        }

        return false;
    }
public function addPermission($permission)
    {
        if (!$this->hasPermission($permission)) {
            return PermissionRole::create(['role_id' => $this->id, 'permission_id' => $permission->id]);
        }

        return false;
    }
public function addPermission ( $ permission ) { if ( ! $ this -> hasPermission ( $ permission ) ) { return PermissionRole :: create ( [ 'role_id' => $ this -> id , 'permission_id' => $ permission -> id ] ) ; } return false ; }
Adds a permission into the role.

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