示例#1
0
 /**
  * Update the specified resource in storage via ajax.
  */
 public function update(TradeRequest $request, $id)
 {
     if ($request->ajax()) {
         $trade = Trade::findOrFail($id);
         $trade->update($request->all());
         // If trade status set to 0 ie. disabled then also
         // need to remove trade from all companys using it??
         return $trade;
     }
     return view('errors.404');
 }
示例#2
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store(TradeRequest $request)
 {
     Trade::create($request->all());
     return redirect('trades');
 }