From e91a537552edda504fa5b438b4b1de7ee3457929 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 27 Sep 2017 14:50:48 -0700 Subject: [PATCH] Use more modern Request handler --- app/Http/Controllers/ComponentsController.php | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/app/Http/Controllers/ComponentsController.php b/app/Http/Controllers/ComponentsController.php index ca09711fd8..80d30f2b0f 100644 --- a/app/Http/Controllers/ComponentsController.php +++ b/app/Http/Controllers/ComponentsController.php @@ -74,20 +74,20 @@ class ComponentsController extends Controller * @since [v3.0] * @return \Illuminate\Http\RedirectResponse */ - public function store() + public function store(Request $request) { $this->authorize('create', Component::class); $component = new Component(); - $component->name = Input::get('name'); - $component->category_id = Input::get('category_id'); - $component->location_id = Input::get('location_id'); - $component->company_id = Company::getIdForCurrentUser(Input::get('company_id')); - $component->order_number = Input::get('order_number'); - $component->min_amt = Input::get('min_amt'); - $component->serial = Input::get('serial'); - $component->purchase_date = Input::get('purchase_date'); - $component->purchase_cost = request('purchase_cost'); - $component->qty = Input::get('qty'); + $component->name = $request->input('name'); + $component->category_id = $request->input('category_id'); + $component->location_id = $request->input('location_id'); + $component->company_id = Company::getIdForCurrentUser($request->input('company_id')); + $component->order_number = $request->input('order_number', null); + $component->min_amt = $request->input('min_amt', null); + $component->serial = $request->input('serial', null); + $component->purchase_date = $request->input('purchase_date', null); + $component->purchase_cost = $request->input('purchase_cost', null); + $component->qty = $request->input('qty'); $component->user_id = Auth::id(); if ($component->save()) {