how to check in request is api call or web call in laravle 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
}