From e5d0f74ba7506da97e3528ccce07453a0080db7e Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 27 Sep 2018 12:06:11 -0700 Subject: [PATCH] Fixed #6248 - add free seats to licenses API endpoint --- app/Http/Controllers/Api/LicensesController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Api/LicensesController.php b/app/Http/Controllers/Api/LicensesController.php index f85fa2314a..5df6c52d3e 100644 --- a/app/Http/Controllers/Api/LicensesController.php +++ b/app/Http/Controllers/Api/LicensesController.php @@ -150,7 +150,7 @@ class LicensesController extends Controller public function show($id) { $this->authorize('view', License::class); - $license = License::findOrFail($id); + $license = License::withCount('freeSeats')->findOrFail($id); $license = $license->load('assignedusers', 'licenseSeats.user', 'licenseSeats.asset'); return (new LicensesTransformer)->transformLicense($license); }