2022-09-06 00:36:14 +02:00
|
|
|
<?php
|
|
|
|
|
2023-04-18 22:08:45 +02:00
|
|
|
namespace App\Invoice;
|
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>
|
|
|
|
*/
|
2023-04-18 22:08:45 +02:00
|
|
|
public function handle(InvoiceSettings $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-11-17 23:59:43 +01:00
|
|
|
'iban' => $settings->iban,
|
|
|
|
'bic' => $settings->bic,
|
2022-09-06 00:36:14 +02:00
|
|
|
];
|
|
|
|
}
|
|
|
|
|
2023-04-18 22:08:45 +02:00
|
|
|
public function asController(InvoiceSettings $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),
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
}
|