chengbin du
chengbin du

Reputation: 602

Laravel 5 redirect function source code

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

Answers (2)

chengbin du
chengbin du

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

Alexey Mezenin
Alexey Mezenin

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

Related Questions