From 814992eb7de9a3fed168bb561c12d0bef789df24 Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Thu, 11 Aug 2022 12:47:40 -0700 Subject: [PATCH] allows company and location ids to be null --- app/Http/Controllers/DepartmentsController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/DepartmentsController.php b/app/Http/Controllers/DepartmentsController.php index 920cc1f2b4..4b2b97ce7f 100644 --- a/app/Http/Controllers/DepartmentsController.php +++ b/app/Http/Controllers/DepartmentsController.php @@ -54,7 +54,8 @@ class DepartmentsController extends Controller $department->fill($request->all()); $department->user_id = Auth::user()->id; $department->manager_id = ($request->filled('manager_id') ? $request->input('manager_id') : null); - + $department->location_id = ($request->filled('location_id') ? $request->input('location_id') : null); + $department->company_id = ($request->filled('company_id') ? $request->input('company_id') : null); $department = $request->handleImages($department); if ($department->save()) { @@ -167,6 +168,8 @@ class DepartmentsController extends Controller $department->fill($request->all()); $department->manager_id = ($request->filled('manager_id') ? $request->input('manager_id') : null); + $department->location_id = ($request->filled('location_id') ? $request->input('location_id') : null); + $department->company_id = ($request->filled('company_id') ? $request->input('company_id') : null); $department = $request->handleImages($department);