app/Http/Controllers/CooperateController.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',
            'descript' => 'required|max:500',
            'image_thumb' => 'required',
            'link' => 'required',
            'image_big' => 'required',
            'contentInfo' => 'required'
        ]);
        $coop = CooperateInfo::find($id);
        if($coop != null) {
            $coop = CooperateInfo::setData($coop, $request);
            $coop->save();
            return redirect()->route('cooperate.index');
        }
        return redirect()->route('404');
    }
public function update ( Request $ request , $ id ) { $ this -> validate ( $ request , [ 'title' => 'required|max:100' , 'descript' => 'required|max:500' , 'image_thumb' => 'required' , 'link' => 'required' , 'image_big' => 'required' , 'contentInfo' => 'required' ] ) ; $ coop = CooperateInfo :: find ( $ id ) ; if ( $ coop != null ) { $ coop = CooperateInfo :: setData ( $ coop , $ request ) ; $ coop -> save ( ) ; return redirect ( ) -> route ( 'cooperate.index' ) ; } return redirect ( ) -> route ( '404' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .