Skip to content

Commit 6ff8659

Browse files
authored
add inertia_location helper (#491)
1 parent b8f36e8 commit 6ff8659

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

helpers.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,18 @@ function inertia($component = null, $props = [])
1919
return $instance;
2020
}
2121
}
22+
23+
if (! function_exists('inertia_location')) {
24+
/**
25+
* Inertia location helper.
26+
*
27+
* @param string url
28+
* @return \Symfony\Component\HttpFoundation\Response
29+
*/
30+
function inertia_location($url)
31+
{
32+
$instance = \Inertia\Inertia::getFacadeRoot();
33+
34+
return $instance->location($url);
35+
}
36+
}

0 commit comments

Comments
 (0)