2022-09-06 00:36:14 +02:00
|
|
|
<?php
|
|
|
|
|
2022-10-18 14:28:46 +02:00
|
|
|
namespace App\Bill;
|
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>
|
|
|
|
*/
|
|
|
|
public function handle(BillSettings $settings): array
|
|
|
|
{
|
|
|
|
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
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
public function asController(BillSettings $settings): Response
|
|
|
|
{
|
|
|
|
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),
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
}
|