Ejemplo n.º 1
0
 public function postDelete(Exchange $exchange)
 {
     $rules = array('confirm' => 'required|in:' . $exchange->name);
     $validator = Validator::make(Input::all(), $rules);
     if ($validator->fails()) {
         return Redirect::route('exchange.delete', ['exchange' => $exchange->slug])->withErrors($validator)->withInput(Input::all());
     } else {
         $exchange->delete();
         return Redirect::route('home');
     }
 }