app/Http/Controllers/OurServiceController.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:200',
            'image' => 'required',
            'contentInfo' => 'required',
            'description' => "required"
        ]);
        $ourService = OurService::find($id);
        if ($ourService != null) {
            $ourService->title = $request->title;
            $ourService->image = $request->image;
            $ourService->description = Purifier::clean($request->description);
            $ourService->content = $request->contentInfo;
            $ourService->save();
            return redirect()->route('our_service.index');
        }
        return redirect()->route('404');
    }
public function update ( Request $ request , $ id ) { $ this -> validate ( $ request , [ 'title' => 'required|max:200' , 'image' => 'required' , 'contentInfo' => 'required' , 'description' => " required " ] ) ; $ ourService = OurService :: find ( $ id ) ; if ( $ ourService != null ) { $ ourService -> title = $ request -> title ; $ ourService -> image = $ request -> image ; $ ourService -> description = Purifier :: clean ( $ request -> description ) ; $ ourService -> content = $ request -> contentInfo ; $ ourService -> save ( ) ; return redirect ( ) -> route ( 'our_service.index' ) ; } return redirect ( ) -> route ( '404' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .