app/Http/Controllers/CustomerStoryController.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)
    {
        if(!empty($cusStory = CustomerStory::find($id))) {
            $this->validate($request, [
                'title' => 'required|max:200',
                'writer' => 'required|max:200',
                'description' => 'required',
                'image_thumb' => 'required',
                'contentInfo' => 'required'
            ]);
            $cusStory = CustomerStory::setData($cusStory, $request);
            $cusStory->save();
            return redirect()->route('customer_story.index');
        }
        return redirect()->route('404');
    }
public function update ( Request $ request , $ id ) { if ( ! empty ( $ cusStory = CustomerStory :: find ( $ id ) ) ) { $ this -> validate ( $ request , [ 'title' => 'required|max:200' , 'writer' => 'required|max:200' , 'description' => 'required' , 'image_thumb' => 'required' , 'contentInfo' => 'required' ] ) ; $ cusStory = CustomerStory :: setData ( $ cusStory , $ request ) ; $ cusStory -> save ( ) ; return redirect ( ) -> route ( 'customer_story.index' ) ; } return redirect ( ) -> route ( '404' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .