From e2e06760928519e0018b4c96f5902495034e7e04 Mon Sep 17 00:00:00 2001 From: farhantock Date: Fri, 19 Jan 2024 11:19:23 +0700 Subject: [PATCH] add new response appConfig --- app/Http/Controllers/AuthController.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Http/Controllers/AuthController.php b/app/Http/Controllers/AuthController.php index 37ae48f..7ef300e 100644 --- a/app/Http/Controllers/AuthController.php +++ b/app/Http/Controllers/AuthController.php @@ -8,6 +8,7 @@ use Illuminate\Support\Facades\Hash; use App\Models\User; use App\Models\Role; +use App\Models\Company; use Illuminate\Http\JsonResponse; use Illuminate\Support\Facades\Password; use Illuminate\Validation\ValidationException; @@ -58,6 +59,10 @@ class AuthController extends Controller $dataRole = Role::find($user->role_id); $dataHierarchy = $this->getDataHierarchy($user->divisi_id, $user->id); + $configApp = Company::where('id', $user->company_id)->first(); + + if ($configApp) + $user->configApp = $configApp; if ($dataRole) $user->role = $dataRole;