public function update($id) { // save updated $record = $this->records->find($id); if (!$record) { Spendcat::create(Input::all()); return $this->respond($record); } $record->fill(Input::all())->save(); return $this->respond($record); }
public function run() { DB::table('spendcats')->delete(); Spendcat::create(['category' => 'fertilizer']); Spendcat::create(['category' => 'seed']); Spendcat::create(['category' => 'fungicide']); Spendcat::create(['category' => 'herbicide']); Spendcat::create(['category' => 'insecticide']); Spendcat::create(['category' => 'custom']); Spendcat::create(['category' => 'fuel']); Spendcat::create(['category' => 'labor']); Spendcat::create(['category' => 'repairs']); Spendcat::create(['category' => 'insurance']); Spendcat::create(['category' => 'harvesting']); Spendcat::create(['category' => 'misc_acres']); }