adrema/app/Letter/SettingIndexAction.php

40 lines
952 B
PHP
Raw Normal View History

2022-09-06 00:36:14 +02:00
<?php
2022-11-07 16:18:11 +01:00
namespace App\Letter;
2022-09-06 00:36:14 +02:00
use Inertia\Inertia;
use Inertia\Response;
use Lorisleiva\Actions\Concerns\AsAction;
class SettingIndexAction
{
use AsAction;
/**
* @return array<string, string>
*/
2022-11-07 16:18:11 +01:00
public function handle(LetterSettings $settings): array
2022-09-06 00:36:14 +02:00
{
return [
2022-10-18 14:28:46 +02:00
'from_long' => $settings->from_long,
'from' => $settings->from,
'mobile' => $settings->mobile,
'email' => $settings->email,
'website' => $settings->website,
'address' => $settings->address,
'place' => $settings->place,
'zip' => $settings->zip,
2022-09-06 00:36:14 +02:00
];
}
2022-11-07 16:18:11 +01:00
public function asController(LetterSettings $settings): Response
2022-09-06 00:36:14 +02:00
{
session()->put('menu', 'setting');
2022-10-20 02:15:28 +02:00
session()->put('title', 'Rechnungs-Einstellungen');
2022-09-06 00:36:14 +02:00
2022-10-20 02:15:28 +02:00
return Inertia::render('setting/Bill', [
2022-09-06 00:36:14 +02:00
'data' => $this->handle($settings),
]);
}
}