예제 #1
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @param CouponRequest $request
  * @return Response
  */
 public function update(Requests\CouponRequest $request, $id)
 {
     $post = Post::find($id);
     $post->slug = $request->input('slug');
     $post->title = $request->input('title');
     $post->content = $request->input('content');
     $post->category_id = $request->input('category_id');
     $post->comments = $request->input('comments');
     $post->featured = $request->input('featured');
     $post->status = $request->input('status');
     $post->summary = $request->input('summary');
     // Save New post
     $post->save();
     // Set Flash Message Success Text
     session()->flash('flash_message', '' . $post->title . ' Updated!');
     return redirect('post/' . $post->slug . '');
 }
예제 #2
0
 public function update(Requests\CouponRequest $request, $id)
 {
     $input = $request->all();
     $coupon = Coupons::find($id);
     // Set inputs to update
     $coupon->p1 = $input['p1'];
     $coupon->p2 = $input['p2'];
     $coupon->title = $input['title'];
     $coupon->size = $input['size'];
     $coupon->date = $input['date'];
     $coupon->industry = $input['industry'];
     $coupon->settlement = $input['settlement'];
     $coupon->judge = $input['judge'];
     $coupon->jurisdiction = $input['jurisdiction'];
     $coupon->court_type = $input['court_type'];
     $coupon->{'case-status'} = $input['case_status'];
     $coupon->{'case-type'} = $input['case_type'];
     $coupon->{'case-number'} = $input['case_number'];
     // Save New Coupon
     $coupon->save();
     // Set Flash Message Success Text
     session()->flash('flash_message', '' . $coupon->title . ' Updated!');
     return redirect('cases/' . $coupon->slug . '');
 }
예제 #3
0
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(CouponRequest $request, $id)
 {
     $coupon = $this->coupon->update($request->all());
     return redirect('admin/coupon')->with(array('status' => 'success', 'message' => 'Le coupon a été mis à jour'));
 }