Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit a730d20

Browse files
committed
Drop incomplete Turbolinks-Location redirection and other useless code
1 parent 484d8ba commit a730d20

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Support/helpers.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,19 @@ function domain()
2727
*/
2828
function intend(array $arguments, int $status = 302)
2929
{
30-
$redirect = redirect($url = array_pull($arguments, 'url'), $status);
31-
$status = $status ?: (isset($arguments['withErrors']) ? 422 : 200);
30+
$redirect = redirect(array_pull($arguments, 'url'), $status);
3231

3332
if (request()->expectsJson()) {
3433
$response = collect($arguments['withErrors'] ?? $arguments['with']);
3534

36-
return response()->json([$response->flatten()->first() ?? 'OK'], 200)->header('Turbolinks-Location', $url);
35+
return response()->json([$response->flatten()->first() ?? 'OK']);
3736
}
3837

3938
foreach ($arguments as $key => $value) {
4039
$redirect = in_array($key, ['home', 'back']) ? $redirect->{$key}() : $redirect->{$key}($value);
4140
}
4241

43-
return $redirect->header('Turbolinks-Location', $url);
42+
return $redirect;
4443
}
4544
}
4645

0 commit comments

Comments
 (0)