Example #1
0
 public function show($id)
 {
     $quote = Quote::findOrFail($id);
     return Response::json($quote);
 }
 /**
  * Update the specified quote in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     if (!Sentry::getUser()) {
         return Redirect::route('sessions.create');
     }
     $quote = Quote::findOrFail($id);
     $validator = Validator::make($data = Input::all(), Quote::$rules);
     if ($validator->fails()) {
         return Redirect::back()->withErrors($validator)->withInput();
     }
     $quote->update($data);
     return Redirect::route('quotes.index');
 }