public function update($id)
 {
     // save updated
     $record = $this->records->find($id);
     if (!$record) {
         Loanfinancial::create(Input::all());
         return $this->respond($record);
     }
     $record->fill(Input::all())->save();
     return $this->respond($record);
 }
 public function run()
 {
     DB::table('loanfinancials')->delete();
     //2 - Ag-Input
     Loanfinancial::create(['loan_id' => 1, 'collateral_equipment' => 300000, 'collateral_realestate' => 500000, 'fee_processing' => 1, 'fee_service' => 1.5, 'int_percent_arm' => 9, 'int_percent_arm_default' => 9, 'int_percent_arm_orig' => 9, 'int_percent_dist' => 9, 'int_percent_other' => 9]);
     //Like Excel
     Loanfinancial::create(['loan_id' => 9, 'fee_processing' => 1, 'fee_service' => 1.5, 'int_percent_arm' => 12, 'int_percent_arm_default' => 12, 'int_percent_arm_orig' => 12, 'int_percent_dist' => 9, 'int_percent_dist_default' => 9, 'int_percent_dist_orig' => 9, 'int_percent_other' => 11, 'int_percent_other_default' => 11, 'int_percent_other_orig' => 11]);
     //5 - Capital Bridge
     Loanfinancial::create(['loan_id' => 2, 'amount_requested' => 25000000, 'fee_processing' => 1, 'fee_service' => 1.5, 'int_percent_arm' => 9, 'int_percent_arm_default' => 9, 'int_percent_arm_orig' => 9, 'int_percent_other' => 9, 'int_percent_other_default' => 9, 'int_percent_other_orig' => 9]);
     //4 - Ag-Pro Fasttrack
     Loanfinancial::create(['loan_id' => 3, 'amount_requested' => 25000000, 'fee_processing' => 1, 'fee_service' => 1.5, 'int_percent_arm' => 9, 'int_percent_arm_default' => 9, 'int_percent_arm_orig' => 9, 'int_percent_other' => 9, 'int_percent_other_default' => 9, 'int_percent_other_orig' => 9]);
     //6 - Ag-Vest
     Loanfinancial::create(['loan_id' => 4, 'fee_service' => 4, 'int_percent_arm' => 6, 'int_percent_arm_default' => 6, 'int_percent_arm_orig' => 6]);
     //3 - Ag-Pro
     Loanfinancial::create(['loan_id' => 5, 'amount_requested' => 25000000, 'fee_processing' => 1, 'fee_service' => 1.5, 'int_percent_arm' => 9, 'int_percent_arm_default' => 9, 'int_percent_arm_orig' => 9, 'int_percent_other' => 9, 'int_percent_other_default' => 9, 'int_percent_other_orig' => 9]);
     //1 - All-In
     Loanfinancial::create(['loan_id' => 6, 'fee_processing' => 1, 'fee_service' => 1.5, 'int_percent_arm' => 9, 'int_percent_arm_default' => 9, 'int_percent_arm_orig' => 9]);
     //7 - Grain-Storage
     Loanfinancial::create(['loan_id' => 7, 'amount_requested' => 200000, 'fee_processing' => 1, 'fee_service' => 1.5, 'int_percent_arm' => 9, 'int_percent_arm_default' => 9, 'int_percent_arm_orig' => 9]);
     //2 - Ag-Input
     Loanfinancial::create(['loan_id' => 8, 'fee_processing' => 1, 'fee_service' => 1.5, 'int_percent_arm' => 9, 'int_percent_arm_default' => 9, 'int_percent_arm_orig' => 9, 'int_percent_dist' => 9, 'int_percent_dist_default' => 9, 'int_percent_dist_orig' => 9, 'int_percent_other' => 9, 'int_percent_other_default' => 9, 'int_percent_other_orig' => 9]);
 }
Пример #3
0
 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]);
 }