Answers for "laravel check if api request"

PHP
0

laravel check if api request

if (Request::wantsJson()) {
    // return JSON-formatted response
} else {
    // return HTML response
}
Posted by: Guest on March-23-2020

Code answers related to "laravel check if api request"

Browse Popular Code Answers by Language