From 07bafa9508e2f699fa32609c3127e0445ab94cf7 Mon Sep 17 00:00:00 2001 From: Robert-Azelis <82208283+Robert-Azelis@users.noreply.github.com> Date: Sun, 13 Aug 2023 17:15:20 +0200 Subject: [PATCH] Update CompaniesController.php --- app/Http/Controllers/Api/CompaniesController.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Http/Controllers/Api/CompaniesController.php b/app/Http/Controllers/Api/CompaniesController.php index 72297440dd..42b5302448 100644 --- a/app/Http/Controllers/Api/CompaniesController.php +++ b/app/Http/Controllers/Api/CompaniesController.php @@ -29,6 +29,7 @@ class CompaniesController extends Controller 'name', 'phone', 'fax', + 'email', 'created_at', 'updated_at', 'users_count', @@ -49,6 +50,10 @@ class CompaniesController extends Controller $companies->where('name', '=', $request->input('name')); } + if ($request->filled('email')) { + $companies->where('email', '=', $request->input('email')); + } + // Make sure the offset and limit are actually integers and do not exceed system limits $offset = ($request->input('offset') > $companies->count()) ? $companies->count() : abs($request->input('offset')); @@ -168,6 +173,7 @@ class CompaniesController extends Controller $companies = Company::select([ 'companies.id', 'companies.name', + 'companies.email', 'companies.image', ]);