Get the current & the previous URL

There are times when we need to redirect a user back to its previous URL or when we need to check what the current URL is to confirm some trick actions.

Until now, we have been doing this using various complicated PHP core functions but Laravel makes it all very easy for us. You can use the following code for doing so. Get the current URL

Get the previous URL

url()->previous()

Get the current URL

url()->current()

 Url,  Helpers,