Skip to content

Commit

Permalink
Import class
Browse files Browse the repository at this point in the history
  • Loading branch information
szepeviktor authored Oct 26, 2023
1 parent 56766b0 commit 3f0e306
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Http/Controllers/MediaController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Gate;
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;

class MediaController extends Controller
{
Expand All @@ -27,7 +28,7 @@ public function __invoke(Request $request): JsonResponse
'GET' => new JsonResponse($field->paginate($request, $model)),
'POST' => new JsonResponse($field->upload($request, $model), JsonResponse::HTTP_CREATED),
'DELETE' => new JsonResponse(['deleted' => $field->prune($request, $model, $request->input('ids', []))]),
default => throw new \Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException(),
default => throw new MethodNotAllowedHttpException(),
};
}
}

0 comments on commit 3f0e306

Please sign in to comment.