public function run() { DB::table('globvars')->delete(); $collection = [['crop_year' => '2015', 'season' => 'S']]; foreach ($collection as $record) { Globvar::create($record); } }
public function update($id) { // save updated $record = $this->records->find($id); if (!$record) { Globvar::create(Input::all()); return $this->respond($record); } $record->fill(Input::all())->save(); return $this->respond($record); }