31 lines
1.0 KiB
PHP
31 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Domains\Admin\Controllers;
|
|
|
|
use App\Scopes\CommonController;
|
|
use Illuminate\Http\JsonResponse;
|
|
use Illuminate\Http\Request;
|
|
|
|
class ManagedTenantContactGetController extends CommonController
|
|
{
|
|
public function __invoke(string $slug, Request $request): JsonResponse
|
|
{
|
|
$tenant = $this->adminTenants->findBySlug($slug);
|
|
|
|
return response()->json([
|
|
'email' => $tenant->email,
|
|
'email_finance' => $tenant->email_finance,
|
|
'invoice_sender_name' => $tenant->invoice_sender_name,
|
|
// Als Platzhalter im Formular: so heisst der Absender, solange nichts eingetragen ist.
|
|
'name' => $tenant->name,
|
|
'phone' => $tenant->phone,
|
|
'address_1' => $tenant->address_1,
|
|
'address_2' => $tenant->address_2,
|
|
'address_3' => $tenant->address_3,
|
|
'postcode' => $tenant->postcode,
|
|
'city' => $tenant->city,
|
|
'saveEndpoint' => '/api/v1/admin/tenants/' . $slug . '/contact',
|
|
]);
|
|
}
|
|
}
|