Reload and redirect
The response tells the browser to reload the page or to go to another URL, right away or after a delay.
Reloads the page, now or after the delay.
Loads the URL in full, now or after the delay.
Replaces this page in the history: the back button does not return to it, e.g. to a form that was sent.
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.
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();
}
}
The response tells the browser to reload the page or to go to another URL, right away or after a delay.
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.