|
|
@@ -50,14 +50,14 @@ Route::middleware('auth:web')->group(function () {
|
|
|
session(['year' => $request->year]);
|
|
|
}
|
|
|
|
|
|
- $previousUrl = url()->previous();
|
|
|
+ $targetUrl = session('last_web_url');
|
|
|
$currentUrl = $request->fullUrl();
|
|
|
|
|
|
- $previousHost = parse_url($previousUrl, PHP_URL_HOST);
|
|
|
+ $targetHost = parse_url((string) $targetUrl, PHP_URL_HOST);
|
|
|
$currentHost = $request->getHost();
|
|
|
|
|
|
- if (!empty($previousUrl) && $previousUrl !== $currentUrl && (!$previousHost || $previousHost === $currentHost)) {
|
|
|
- return redirect()->to($previousUrl);
|
|
|
+ if (!empty($targetUrl) && $targetUrl !== $currentUrl && (!$targetHost || $targetHost === $currentHost)) {
|
|
|
+ return redirect()->to($targetUrl);
|
|
|
}
|
|
|
|
|
|
return redirect()->route('order.index');
|