Basic tenant structure
This commit is contained in:
26
app/Providers/InertiaProvider.php
Normal file
26
app/Providers/InertiaProvider.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?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
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user