adrema/app/Bill/SettingIndexAction.php

41 lines
967 B
PHP
Raw Normal View History

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
2022-10-18 14:28:46 +02:00
use App\Setting\BillSettings;
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');
session()->put('title', 'Einstellungen');
return Inertia::render('setting/Index', [
'data' => $this->handle($settings),
]);
}
}