2022-11-17 02:15:29 +01:00
|
|
|
<?php
|
|
|
|
|
2023-04-29 21:30:41 +02:00
|
|
|
namespace App\Dashboard\Actions;
|
2022-11-17 02:15:29 +01:00
|
|
|
|
2023-04-29 21:30:41 +02:00
|
|
|
use App\Dashboard\DashboardFactory;
|
2022-11-17 02:15:29 +01:00
|
|
|
use Illuminate\Http\Request;
|
|
|
|
use Inertia;
|
|
|
|
use Inertia\Response;
|
|
|
|
use Lorisleiva\Actions\Concerns\AsAction;
|
|
|
|
|
|
|
|
class IndexAction
|
|
|
|
{
|
|
|
|
use AsAction;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return array<array-key, mixed>
|
|
|
|
*/
|
|
|
|
public function handle(): array
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'blocks' => app(DashboardFactory::class)->render(),
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
public function asController(Request $request): Response
|
|
|
|
{
|
|
|
|
session()->put('menu', 'dashboard');
|
|
|
|
session()->put('title', 'Dashboard');
|
|
|
|
|
2023-04-29 21:30:41 +02:00
|
|
|
return Inertia::render('dashboard/VIndex', $this->handle());
|
2022-11-17 02:15:29 +01:00
|
|
|
}
|
|
|
|
}
|