Exemplo n.º 1
0
 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 10) as $index) {
         PodBattery::create(['installed_date' => $faker->dateTime(), 'capacity' => '150', 'brand' => 'Duracell', 'pod_inventory_id' => rand(1, 2)]);
     }
 }
Exemplo n.º 2
0
 /**
  * Store a newly created podbattery in storage.
  *
  * @return Response
  */
 public function store()
 {
     $validator = Validator::make($data = Input::all(), PodBattery::$rules);
     if ($validator->fails()) {
         return Redirect::back()->withErrors($validator)->withInput();
     }
     PodBattery::create($data);
     return Redirect::route('pod_batteries.index');
 }