Heimdall/vendor/inertiajs/inertia-laravel/helpers.php
2022-03-10 13:41:17 +00:00

21 lines
499 B
PHP

<?php
if (! function_exists('inertia')) {
/**
* Inertia helper.
*
* @param null|string $component
* @param array|\Illuminate\Contracts\Support\Arrayable $props
* @return \Inertia\ResponseFactory|\Inertia\Response
*/
function inertia($component = null, $props = [])
{
$instance = \Inertia\Inertia::getFacadeRoot();
if ($component) {
return $instance->render($component, $props);
}
return $instance;
}
}