Thanks to visit codestin.com
Credit goes to github.com

Skip to content

URI #53731

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Dec 9, 2024
Merged

URI #53731

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"league/commonmark": "^2.2.1",
"league/flysystem": "^3.25.1",
"league/flysystem-local": "^3.25.1",
"league/uri": "^7.5.1",
"monolog/monolog": "^3.0",
"nesbot/carbon": "^2.72.2|^3.4",
"nunomaduro/termwind": "^2.0",
Expand Down
12 changes: 12 additions & 0 deletions src/Illuminate/Foundation/Providers/FoundationServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
use Illuminate\Support\AggregateServiceProvider;
use Illuminate\Support\Defer\DeferredCallbackCollection;
use Illuminate\Support\Facades\URL;
use Illuminate\Support\Uri;
use Illuminate\Testing\LoggedExceptionCollection;
use Illuminate\Testing\ParallelTestingServiceProvider;
use Illuminate\Validation\ValidationException;
Expand Down Expand Up @@ -89,6 +90,7 @@ public function register()
$this->registerDumper();
$this->registerRequestValidation();
$this->registerRequestSignatureValidation();
$this->registerUriUrlGeneration();
$this->registerDeferHandler();
$this->registerExceptionTracking();
$this->registerExceptionRenderer();
Expand Down Expand Up @@ -188,6 +190,16 @@ public function registerRequestSignatureValidation()
});
}

/**
* Register the "defer" function termination handler.
*
* @return void
*/
protected function registerUriUrlGeneration()
{
Uri::setUrlGeneratorResolver(fn () => app('url'));
}

/**
* Register the "defer" function termination handler.
*
Expand Down
11 changes: 11 additions & 0 deletions src/Illuminate/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use Illuminate\Support\Traits\Macroable;
use Illuminate\Support\Uri;
use RuntimeException;
use Symfony\Component\HttpFoundation\Exception\SessionNotFoundException;
use Symfony\Component\HttpFoundation\InputBag;
Expand Down Expand Up @@ -88,6 +89,16 @@ public function method()
return $this->getMethod();
}

/**
* Get a URI instance for the request.
*
* @return \Illuminate\Support\Uri
*/
public function uri()
{
return Uri::of($this->fullUrl());
}

/**
* Get the root URL for the application.
*
Expand Down
Loading