Livewire Urls is an amazing package that gives you a simple way to retrieve the current and previous URL in Livewire. This means that the usual methods like URL()->current() point to an internal Livewire route, instead of the "real route" your user is on.
Current URL use RalphJSmit\Livewire\Urls\Facades\Url; $currentUrl = Url::current(); Current route $currentRouteName = Url::currentRoute(); The Url::currentRoute() returns null when the user is on a route without a name. Previous url $previousUrl = Url::previous(); The Url::previous() method returns null when there isn't a previous route available.
The Url::lastRecorded() would give you the URL of page A. The function returns null when there isn't another URL found, apart from the current session.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.