27 lines
478 B
PHP
27 lines
478 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use Inertia\Inertia;
|
|
use Inertia\Response;
|
|
|
|
final class InertiaProvider
|
|
{
|
|
private string $vueFile;
|
|
private array $props;
|
|
|
|
public function __construct(string $vueFile, array $props) {
|
|
$this->vueFile = $vueFile;
|
|
$this->props = $props;
|
|
|
|
}
|
|
|
|
|
|
public function render() : Response {
|
|
return Inertia::render(
|
|
str_replace('/', '/Views/', $this->vueFile),
|
|
$this->props
|
|
);
|
|
}
|
|
}
|