diff --git a/app/Http/Controllers/Api/CategoriesController.php b/app/Http/Controllers/Api/CategoriesController.php index 2aa4b3741c..a4eb192bc2 100644 --- a/app/Http/Controllers/Api/CategoriesController.php +++ b/app/Http/Controllers/Api/CategoriesController.php @@ -8,9 +8,9 @@ use App\Http\Transformers\CategoriesTransformer; use App\Http\Transformers\SelectlistTransformer; use App\Models\Category; use Illuminate\Http\Request; +use Illuminate\Http\JsonResponse; use App\Http\Requests\ImageUploadRequest; use Illuminate\Support\Facades\Storage; -use Illuminate\Support\Facades\Validator; class CategoriesController extends Controller { @@ -21,7 +21,7 @@ class CategoriesController extends Controller * @since [v4.0] * @return \Illuminate\Http\Response */ - public function index(Request $request) + public function index(Request $request) : array { $this->authorize('view', Category::class); $allowed_columns = [ @@ -115,7 +115,7 @@ class CategoriesController extends Controller * @param \App\Http\Requests\ImageUploadRequest $request * @return \Illuminate\Http\Response */ - public function store(ImageUploadRequest $request) + public function store(ImageUploadRequest $request) : JsonResponse { $this->authorize('create', Category::class); $category = new Category; @@ -136,9 +136,8 @@ class CategoriesController extends Controller * @author [A. Gianotto] [] * @since [v4.0] * @param int $id - * @return \Illuminate\Http\Response */ - public function show($id) + public function show($id) : array { $this->authorize('view', Category::class); $category = Category::withCount('assets as assets_count', 'accessories as accessories_count', 'consumables as consumables_count', 'components as components_count', 'licenses as licenses_count')->findOrFail($id); @@ -156,7 +155,7 @@ class CategoriesController extends Controller * @param int $id * @return \Illuminate\Http\Response */ - public function update(ImageUploadRequest $request, $id) + public function update(ImageUploadRequest $request, $id) : JsonResponse { $this->authorize('update', Category::class); $category = Category::findOrFail($id);