How to throw a json response error in laravel outside the controller or any part of the application?
something like that
throw new ConflictException('any')
How to throw a json response error in laravel outside the controller or any part of the application?
something like that
throw new ConflictException('any')
you throw your exceptions and then laravel handle it automatically for Json or web when you use accept:application/json in request param