1 year ago

How to pass data to PATCH

Posted 1 year ago by nyel-dev

I have this code:

{{ html()->modelForm($role, 'PATCH', route('admin.auth.role.update', $role))->class('form-horizontal')->open() }}

I would like to ask what is the first parameter $role and what is the third parameter $role?

and also how do I pass the data from the form to the controller? What I was doing before is I am passing the ID of the item and the array of values but now my controller is receiving this:

public function update(UpdateRoleRequest $request, Role $role)
        $this->roleRepository->update($role, $request->only('name', 'permissions'));

        return redirect()->route('admin.auth.role.index')->withFlashSuccess(__('alerts.backend.roles.updated'));

Please sign in or create an account to participate in this conversation.