예제 #1
0
 public function run()
 {
     DB::table('insopts')->delete();
     $collection = [['option' => 'PF'], ['option' => 'PT'], ['option' => 'SE'], ['option' => 'HE'], ['option' => 'SCO'], ['option' => 'STAX']];
     foreach ($collection as $record) {
         Insopt::create($record);
     }
 }
예제 #2
0
 public function update($id)
 {
     // save updated
     $record = $this->records->find($id);
     if (!$record) {
         Insopt::create(Input::all());
         return $this->respond($record);
     }
     $record->fill(Input::all())->save();
     return $this->respond($record);
 }