GitHub

Refresh & Redirecting

A response can reload the page or send the browser to another URL, right away or after a delay (in milliseconds). A redirect can also replace the page in the history, or keep the layout with a page transition. See Redirecting in the docs.
  • reload($delay)

    Reloads the page, now or after the delay.

  • redirect($url, $delay)

    Loads the URL in full, now or after the delay.

  • replace: true

    Replaces this page in the history: the back button does not return to it, e.g. to a form that was sent.

  • transition: true

    Loads the URL with a page transition: the layout stays and only the content is replaced. Keep it off when the layout changes, e.g. after a login.

Controller.php
namespace App\Http\Controllers;

use App\Arch\BigPipe\AsyncResponse;
use Illuminate\Http\Request;

class UsersController extends Controller
{
    public function onboarding(Request $request)
    {
        ...

        return (new AsyncResponse())
            ->redirect('/', 500)
            ->send();
    }

    public function register(Request $request)
    {
        ...

        // The back button does not return to the sent form,
        // and the next page keeps the layout.
        return (new AsyncResponse())
            ->redirect('/', replace: true, transition: true)
            ->send();
    }
}
Try it

Replace the history, keep the layout

Replace: the tutorial is replaced in the history, so the back button on the home page skips it. Page transition: only the content is loaded, the top bar stays and nothing flashes, like when you follow a link.