Skip to content

Commit

Permalink
add inertia_location helper (#491)
Browse files Browse the repository at this point in the history
  • Loading branch information
RoduanKD authored Jan 17, 2023
1 parent b8f36e8 commit 6ff8659
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,18 @@ function inertia($component = null, $props = [])
return $instance;
}
}

if (! function_exists('inertia_location')) {
/**
* Inertia location helper.
*
* @param string url
* @return \Symfony\Component\HttpFoundation\Response
*/
function inertia_location($url)
{
$instance = \Inertia\Inertia::getFacadeRoot();

return $instance->location($url);
}
}

0 comments on commit 6ff8659

Please sign in to comment.