adrema/app/Setting/Actions/ViewAction.php

22 lines
480 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 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());
return Inertia::render('setting/' . ucfirst($settingGroup::group()), $settingGroup->viewData());
}
}