Ejemplo n.º 1
0
 function postCreate()
 {
     $movies = new \App\Movie();
     $movies->title = \Input::get('title');
     $movies->genre = \Input::get('genre');
     $movies->rating = \Input::get('rating');
     $movies->save();
     return "Record Updated";
 }
 function postCreate()
 {
     $movie = new \App\Movie();
     $movie->title = 'Akirachix';
     $movie->genre = 'awesome';
     $movie->rating = '5';
     $movie->save();
     return "Recordupdates";
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     //
     $movieNames = ['Star Wars 1', 'Star Wars 2', 'Star Wars 3', 'Batman', 'Godfather', 'Avatar'];
     foreach ($movieNames as $movieName) {
         $movie = new \App\Movie();
         $movie->name = $movieName;
         $movie->save();
     }
 }
 function postCreate()
 {
     $validator = \App\Movie::runValidator(\Input::all());
     if ($validator->fails()) {
         return \Redirect::back()->withErrors($validator)->withInput();
     }
     $movie = new \App\Movie();
     $movie->title = \Input::get('title');
     $movie->genre = \Input::get('genre');
     $movie->rating = \Input::get('rating');
     $movie->save();
     return \Redirect::to('movies');
 }