Skip to content

Commit

Permalink
Update SupportProvider.php
Browse files Browse the repository at this point in the history
  • Loading branch information
mlantz committed Nov 14, 2024
1 parent f7909e0 commit 3e149c1
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/SupportProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,24 @@ public function boot()
$parsed = parse_url(url()->full());
$realUrl= $parsed['scheme']. '://'. $parsed['host']. $parsed['path'];

return $realUrl === route($route, $parameters);
if ($realUrl === route($route, $parameters)) {
return true;
}

if (url()->full() === route($route, $parameters)) {
return true;
}

return false;
} catch (\Throwable $th) {
return false;
}
});

Collection::macro('toObject', function () {
return json_decode((json_encode($this)));
});

Collection::macro('paginate', function($perPage, $page = null, $pageName = 'page') {
$page = $page ?: LengthAwarePaginator::resolveCurrentPage($pageName);
return new LengthAwarePaginator(
Expand Down

0 comments on commit 3e149c1

Please sign in to comment.