Files
mareike/app/Domains/Admin/Controllers/ManagedTenantPaymentUpdateController.php
T
2026-06-21 20:46:16 +02:00

28 lines
759 B
PHP

<?php
namespace App\Domains\Admin\Controllers;
use App\Models\Tenant;
use App\Scopes\CommonController;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class ManagedTenantPaymentUpdateController extends CommonController
{
public function __invoke(string $slug, Request $request): JsonResponse
{
$tenant = Tenant::where('slug', $slug)->firstOrFail();
$tenant->update([
'account_iban' => $request->input('account_iban'),
'account_bic' => $request->input('account_bic'),
'account_name' => $request->input('account_name'),
]);
return response()->json([
'status' => 'success',
'message' => 'Bezahldaten wurden gespeichert.',
]);
}
}