laravel request external api code example
Example: laravel check if api request
if (Request::wantsJson()) {
// return JSON-formatted response
} else {
// return HTML response
}
if (Request::wantsJson()) {
// return JSON-formatted response
} else {
// return HTML response
}