示例#1
0
 public function run()
 {
     DB::table('globvars')->delete();
     $collection = [['crop_year' => '2015', 'season' => 'S']];
     foreach ($collection as $record) {
         Globvar::create($record);
     }
 }
示例#2
0
 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);
 }