src/Controllers/RoleController.php
public function update(RoleRequest $request, $id)
    {
        $this->authorize('edit_role');

        $role = Roles::where('id', $id)->firstOrFail();
        $role->update($request->all());
        if (!empty($request->permission) AND is_array($request->permission)) {
            $role->permissions()->sync($request->permission);

        } else {
            $role->permissions()->detach();
        }
        $request->session()->flash('message', 'Role Updated Successfully');
        return redirect()->route('RoleManager::role.edit', $role->id);
    }
public function update(RoleRequest $request, $id)
    {
        $this->authorize('edit_role');

        $role = Roles::where('id', $id)->firstOrFail();
        $role->update($request->all());
        if (!empty($request->permission) AND is_array($request->permission)) {
            $role->permissions()->sync($request->permission);

        } else {
            $role->permissions()->detach();
        }
        $request->session()->flash('message', 'Role Updated Successfully');
        return redirect()->route('RoleManager::role.edit', $role->id);
    }
Update the specified resource in storage.

@param Request|RoleRequest $request
@param int                 $id

@return \Illuminate\Http\Response