public function run() { DB::table('globvars')->delete(); $collection = [['crop_year' => '2015', 'season' => 'S']]; foreach ($collection as $record) { Globvar::create($record); } }
public function handle(LoanWasCreated $event) { $cons = Condition::where('loantype_id', $event->loan->loan_type_id)->get(); $globs = Globvar::all(); $g = $globs[0]; foreach ($cons as $con) { Loancondition::create(['loan_id' => $event->loan->id, 'crop_year' => $g->crop_year, 'category' => 'loan', 'condition' => $con->condition]); } }
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); }
public function handle(LoanWasCreated $event) { $globs = Globvar::all(); $g = $globs[0]; $q = Loanfinancial::create(['loan_id' => $event->loan->id, 'fee_processing' => (double) $g->proc_fee_rate, 'fee_service' => (double) $g->svc_fee_rate, 'int_percent_arm' => (double) $g->int_percent_arm, 'int_percent_arm_default' => (double) $g->int_percent_arm, 'int_percent_arm_orig' => (double) $g->int_percent_arm, 'int_percent_dist' => (double) $g->int_percent_dist, 'int_percent_other' => 0]); }
public function handle(LoanWasCreated $event) { $globs = Globvar::all(); $g = $globs[0]; $q = Loandisc::create(['loan_id' => $event->loan->id, 'disc_percent_crop' => (double) $g->projected_crops_discount_rate, 'disc_percent_fsa' => (double) $g->fsa_assignment_discount_rate, 'disc_percent_ins' => (double) $g->ins_discount_rate, 'disc_percent_insoyield' => (double) $g->ins_discount_insoyield, 'disc_percent_nonrp' => (double) $g->yp_discount_rate, 'disc_percent_rphpe' => (double) $g->rphpe_discount_rate, 'disc_percent_suppins' => (double) $g->supins_discount_rate, 'disc_percent_prod' => (double) $g->prod_discount_rate, 'disc_percent_equipment' => (double) $g->equipment_discount_rate, 'disc_percent_realestate' => (double) $g->realestate_discount_rate, 'disc_percent_other' => (double) $g->claims_discount_rate]); }