Reputation: 602
Where is Laravel 5 redirect
function source code?
I use ag "function redirect"
to search where is it definition but I got nothing.
So I want to know where it is, why and how.
Upvotes: 2
Views: 555
Reputation: 602
Because ag
ignores vcs ignores(.gitignore, .hgignore; still obey .ignore), now I got what I want: using ag --php --skip-vcs-ignores "function redirect\("
vendor/laravel/framework/src/Illuminate/Foundation/helpers.php
604: function redirect($to = null, $status = 302, $headers = [], $secure = null)
vendor/symfony/routing/Matcher/RedirectableUrlMatcherInterface.php
30: public function redirect($path, $route, $scheme = null);
vendor/symfony/routing/Tests/Fixtures/RedirectableUrlMatcher.php
22: public function redirect($path, $route, $scheme = null)
Upvotes: 0
Reputation: 163768
It's in vendor/laravel/framework/src/Illuminate/Foundation/helpers.php
:
function redirect($to = null, $status = 302, $headers = [], $secure = null)
{
if (is_null($to)) {
return app('redirect');
}
return app('redirect')->to($to, $status, $headers, $secure);
}
Upvotes: 2