Laravel prüfen, ob die API -Anfrage angewendet wird
if (Request::wantsJson()) {
// return JSON-formatted response
} else {
// return HTML response
}
Cybernated Dev
if (Request::wantsJson()) {
// return JSON-formatted response
} else {
// return HTML response
}