diff --git a/app/Http/Controllers/Api/UsersController.php b/app/Http/Controllers/Api/UsersController.php index 08d007f929..358e20df39 100644 --- a/app/Http/Controllers/Api/UsersController.php +++ b/app/Http/Controllers/Api/UsersController.php @@ -10,6 +10,7 @@ use App\Models\User; use App\Helpers\Helper; use App\Http\Requests\SaveUserRequest; use App\Models\Asset; +use App\Http\Transformers\AssetsTransformer; class UsersController extends Controller { @@ -209,6 +210,7 @@ class UsersController extends Controller { $this->authorize('view', User::class); $assets = Asset::where('assigned_to', '=', $id)->with('model')->get(); - return response()->json($assets); + return (new AssetsTransformer)->transformAssets($assets, $assets->count()); + // return response()->json($assets); } }