app/Http/Controllers/admin/RoleController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request, Role $role)
    {
        $request->validate([
            'name' => 'required'
        ]);
        $role->update($request->all());
        $role->permissions()->sync($request->permissions);
        return redirect()->route('admin.roles.edit', $role)->with('info', 'El rol se actualizó con éxito.');
    }
public function update ( Request $ request , Role $ role ) { $ request -> validate ( [ 'name' => 'required' ] ) ; $ role -> update ( $ request -> all ( ) ) ; $ role -> permissions ( ) -> sync ( $ request -> permissions ) ; return redirect ( ) -> route ( 'admin.roles.edit' , $ role ) -> with ( 'info' , 'El rol se actualizó con éxito.'); }
Update the specified resource in storage.
Update the specified resource in storage .