public function store(Request $request, $id) { $depreciation = \App\Models\Depreciation::create($request->all()); $depreciation->report_id = $id; $depreciation->save(); return Redirect::action('ReportController@depreciation', $id); }
public function testDepreciationAdd() { $depreciations = factory(Depreciation::class, 'depreciation')->make(); $values = ['name' => $depreciations->name, 'months' => $depreciations->months]; Depreciation::create($values); $this->tester->seeRecord('depreciations', $values); }