adrema/app/Dashboard/Actions/IndexAction.php

32 lines
610 B
PHP
Raw Normal View History

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 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(),
];
}
2023-07-30 10:56:43 +02:00
public function asController(): Response
2022-11-17 02:15:29 +01:00
{
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
}
}