From cbe75ce8712f6d703b67738579e22dfa6226e1c2 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 2 Jan 2024 22:06:54 -0700 Subject: [PATCH] Update UserRolesController --- app/Http/Controllers/UserRolesController.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/UserRolesController.php b/app/Http/Controllers/UserRolesController.php index dbd34d0da..65a71d19d 100644 --- a/app/Http/Controllers/UserRolesController.php +++ b/app/Http/Controllers/UserRolesController.php @@ -3,8 +3,21 @@ namespace App\Http\Controllers; use Illuminate\Http\Request; +use App\Services\UserRoleService; class UserRolesController extends Controller { - // + public function __construct() + { + $this->middleware('auth'); + } + + public function getRoles(Request $request) + { + $this->validate($request, [ + 'id' => 'required' + ]); + + return UserRoleService::getRoles($request->user()->id); + } }