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)]); } }
/** * 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'); }