public function run() { DB::table('instypes')->delete(); $collection = [['type' => 'RP'], ['type' => 'YP'], ['type' => 'CAT']]; foreach ($collection as $record) { Instype::create($record); } }
public function update($id) { // save updated $record = $this->records->find($id); if (!$record) { Instype::create(Input::all()); return $this->respond($record); } $record->fill(Input::all())->save(); return $this->respond($record); }