adrema/app/Setting/Actions/ViewAction.php

26 lines
612 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()), [
2024-08-01 18:25:25 +02:00
'data' => $settingGroup->data(),
2024-08-01 17:30:55 +02:00
'settingMenu' => app(SettingFactory::class)->getShare(),
2024-08-01 12:19:28 +02:00
]);
2024-08-01 11:17:49 +02:00
}
}