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