Esempio n. 1
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     $input = Input::all();
     $validation = Validator::make($input, Seance::$rules);
     if ($validation->passes()) {
         $this->seance->create($input);
         return Redirect::route('seances.index');
     }
     return Redirect::route('seances.create')->withInput()->withErrors($validation)->with('message', 'There were validation errors.');
 }
 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 10) as $index) {
         Seance::create([]);
     }
 }
 /**
  * Store a newly created seance in storage.
  *
  * @return Response
  */
 public function store()
 {
     $validator = Validator::make($data = Input::all(), Seance::$rules);
     if ($validator->fails()) {
         return Redirect::back()->withErrors($validator)->withInput();
     }
     Seance::create($data);
     return Redirect::route('backend.seances.index');
 }