returns null on invalid route, so it will call getPrefix() on null that throws 500 instead 404.
also, what if the api has no prefix, but subdomain based api?
I think it should check for the middlewares existance, like follows (You can do it better than me)
/**
* Check for api routes.
*
* @param Request $request
* @return bool
*/
protected function isApiRoute($request)
{
return $request->route() && in_array('api', (array) $request->route()->middleware());
}
returns null on invalid route, so it will call getPrefix() on null that throws 500 instead 404. also, what if the api has no prefix, but subdomain based api?
I think it should check for the middlewares existance, like follows (You can do it better than me)