add the previous page route in laravel code example Example: laravel redirect to previous page url()->previous()