Sven van den Boogaart
Sven van den Boogaart

Reputation: 12327

Laravel upgrade 6 to 7

I'm following the documentationon how to update Laravel 6 to 7 At one point it says:

Symfony Console, which is the underlying component that powers Artisan, expects all commands to return an integer. Therefore, you should ensure that any of your commands which return a value are returning integers:

public function handle()
{
    // Before...
    return true;

    // After...
    return 0;
}

But it is not saying in which file this should be added, does it mean I have to find each and every method that returns something? What about controllers where I return a view e.g.

    return view('front.style', ['style' => $style]);

I looked for the handle method in my project and only found one occurence in a guard.

public function handle($request, Closure $next, $guard = null)
{
    if (Auth::guard($guard)->check()) {
        return redirect(RouteServiceProvider::HOME);
    }

    return $next($request);
}

Should I only update this one and if so what does it need to be replaced with? What it is currently doing "continue with request". The manual also states to update App\Exceptions\Handler to use Throwable instead of Exception and tells which methods need an update:

public function report(Throwable $exception);
public function shouldReport(Throwable $exception);
public function render($request, Throwable $exception);
public function renderForConsole($output, Throwable $exception);

However my project only contains the render and report method. Am I reading the documentation wrong and is there other documentation that is more up to date?

Upvotes: 1

Views: 365

Answers (1)

Divyank
Divyank

Reputation: 788

It's referring to Artisan commands, you can find it in app/Console/Commands

Upvotes: 3

Related Questions