src/Role.php
public function setPermissions(array $permissions)
    {
        if (!$this->id) {
            $this->save();
        }

        $this->revokeAll();

        collect($permissions)->map(function ($permission) {
            $this->grant($permission);
        });
    }
public function setPermissions(array $permissions)
    {
        if (!$this->id) {
            $this->save();
        }

        $this->revokeAll();

        collect($permissions)->map(function ($permission) {
            $this->grant($permission);
        });
    }
Replace all existing permissions with a new set of permissions

@param array $permissions
@return void