public function run() { DB::table('libraryfiletypes')->delete(); $collection = [['filetype' => 'docx'], ['filetype' => 'pdf'], ['filetype' => 'pptx'], ['filetype' => 'xlsx']]; foreach ($collection as $record) { Libraryfiletype::create($record); } }
public function update($id) { // save updated $record = $this->records->find($id); if (!$record) { Libraryfiletype::create(Input::all()); return $this->respond($record); } $record->fill(Input::all())->save(); return $this->respond($record); }