adrema/app/Setting/Actions/ViewAction.php

26 lines
610 B
PHP
Raw Normal View History

2024-08-01 11:17:49 +02:00
<?php
namespace App\Setting\Actions;
2024-08-01 11:32:14 +02:00
use App\Setting\LocalSettings;
2024-08-01 12:19:28 +02:00
use App\Setting\SettingFactory;
2024-08-01 11:17:49 +02:00
use Inertia\Inertia;
use Inertia\Response;
use Lorisleiva\Actions\Concerns\AsAction;
class ViewAction
{
use AsAction;
2024-08-01 11:32:14 +02:00
public function handle(LocalSettings $settingGroup): Response
2024-08-01 11:17:49 +02:00
{
session()->put('menu', 'setting');
session()->put('title', $settingGroup::title());
2024-08-01 12:19:28 +02:00
return Inertia::render('setting/' . ucfirst($settingGroup::group()), [
...$settingGroup->viewData(),
'setting_menu' => app(SettingFactory::class)->getShare(),
]);
2024-08-01 11:17:49 +02:00
}
}