app/Http/Controllers/TypeClientServiceController.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|max:100',
            'descript' =>'required',
        ]);
        $type = TypeClientService::find($id);
        if($type != null) {
            $type->name = $request->name;
            $type->image = $request->image;
            $type->descript = Purifier::clean($request->descript);
            return redirect()->route('type_client_service.index');
        }
        return redirect()->route('404');
    }
public function update ( Request $ request , $ id ) { $ this -> validate ( $ request , [ 'name' => 'required|max:100' , 'descript' => 'required' , ] ) ; $ type = TypeClientService :: find ( $ id ) ; if ( $ type != null ) { $ type -> name = $ request -> name ; $ type -> image = $ request -> image ; $ type -> descript = Purifier :: clean ( $ request -> descript ) ; return redirect ( ) -> route ( 'type_client_service.index' ) ; } return redirect ( ) -> route ( '404' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .