app/Http/Controllers/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, $id)
    {
        $this->validate($request, [
            'name' => 'required',
            'permission' => 'required',
        ]);
        $role = Role::find($id);
        $role->name = $request->input('name');
        $role->save();
        $role->syncPermissions($request->input('permission'));
        return redirect()->route('roles')->withStatus(__('Roles Successfully Updated.'));
    }
public function update ( Request $ request , $ id ) { $ this -> validate ( $ request , [ 'name' => 'required' , 'permission' => 'required' , ] ) ; $ role = Role :: find ( $ id ) ; $ role -> name = $ request -> input ( 'name' ) ; $ role -> save ( ) ; $ role -> syncPermissions ( $ request -> input ( 'permission' ) ) ; return redirect ( ) -> route ( 'roles' ) -> withStatus ( __ ( 'Roles Successfully Updated.' ) ) ; }
Update the specified resource in storage.
Update the specified resource in storage .