app/Http/Controllers/CooperateController.php
/**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
Store a newly created resource in storage.
Store a newly created resource in storage .
public function store(Request $request)
    {
        $this->validate($request,[
            'title' => 'required|max:100',
            'descript' => 'required|max:500',
            'image_thumb' => 'required',
            'link' => 'required',
            'image_big' => 'required',
            'contentInfo' => 'required'
        ]);
        $currentMaxOrder = CooperateInfo::getCurrentMaxOrder();
        $coop =  new CooperateInfo();
        $coop = CooperateInfo::setData($coop, $request);
        $coop->order = $currentMaxOrder + 1;
        $coop->save();
        return redirect()->route('cooperate.index');
    }
public function store ( Request $ request ) { $ this -> validate ( $ request , [ 'title' => 'required|max:100' , 'descript' => 'required|max:500' , 'image_thumb' => 'required' , 'link' => 'required' , 'image_big' => 'required' , 'contentInfo' => 'required' ] ) ; $ currentMaxOrder = CooperateInfo :: getCurrentMaxOrder ( ) ; $ coop = new CooperateInfo ( ) ; $ coop = CooperateInfo :: setData ( $ coop , $ request ) ; $ coop -> order = $ currentMaxOrder + 1 ; $ coop -> save ( ) ; return redirect ( ) -> route ( 'cooperate.index' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .