mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-11 11:22:18 +00:00
Merge pull request #271 from skipperbent/v3-feature-uri
Added Uri class which can be used to parse urls.
This commit is contained in:
@@ -746,7 +746,7 @@ class CustomExceptionHandler implements IExceptionHandler
|
||||
|
||||
/* You can use the exception handler to format errors depending on the request and type. */
|
||||
|
||||
if (stripos($request->getUri(), '/api') !== false) {
|
||||
if (stripos($request->getUri()->getPath(), '/api') !== false) {
|
||||
|
||||
response()->json([
|
||||
'error' => $error->getMessage(),
|
||||
@@ -1131,7 +1131,7 @@ class CustomRouterRules implement IRouterBootManager {
|
||||
|
||||
// If the current uri matches the url, we use our custom route
|
||||
|
||||
if($request->getUri() === $url) {
|
||||
if($request->getUri()->getPath() === $url) {
|
||||
$request->setRewriteUrl($rule);
|
||||
return $request;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user