app/Http/Controllers/ClientServiceController.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, [
            'title'=>'required|max:100',
            'type_service' => 'required',
            'image' => 'required',
            'contentInfo' =>'required',
        ]);
        $clientService = ClientService::find($id);
        if ($clientService != null) {
            $clientService->title = $request->title;
            $clientService->image = $request->image;
            $clientService->type_client_service_id = $request->type_service;
            $clientService->content = $request->contentInfo;
            $clientService->save();
            return redirect()->route('client_service.index');
        }
        return redirect()->route('404');
    }
public function update ( Request $ request , $ id ) { $ this -> validate ( $ request , [ 'title' => 'required|max:100' , 'type_service' => 'required' , 'image' => 'required' , 'contentInfo' => 'required' , ] ) ; $ clientService = ClientService :: find ( $ id ) ; if ( $ clientService != null ) { $ clientService -> title = $ request -> title ; $ clientService -> image = $ request -> image ; $ clientService -> type_client_service_id = $ request -> type_service ; $ clientService -> content = $ request -> contentInfo ; $ clientService -> save ( ) ; return redirect ( ) -> route ( 'client_service.index' ) ; } return redirect ( ) -> route ( '404' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .