PHP Rebuild
CI / ci (push) Canceled after 0s

Initial PHP rebuild of the app
This commit is contained in:
Stefan Lazic committed 2026-09-05 08:21:33 +01:00
1 parent 8a2b211069
commit 2ef3654841
690 files changed
+33944 -12046

No files matched your search

@@ -0,0 +1,36 @@
<?php
namespace App\Http\Controllers;
use App\Services\Loyalty\LoyaltyService;
use App\Services\Tenant\TenantContext;
use Illuminate\Http\Request;
use Illuminate\View\View;
class CustomerAccountController extends Controller
{
public function __invoke(Request $request, TenantContext $tenant, LoyaltyService $loyalty): View
{
$business = $tenant->require();
$business->loadMissing(['staff.user', 'serviceCategories.services']);
$profile = $request->user()->customerProfiles()
->where('businessId', $business->id)
->first();
$appointments = $profile?->appointments()
->with(['staff.user', 'services.service'])
->where('startAt', '>=', now()->utc())
->orderBy('startAt')
->get() ?? collect();
$loyaltySummary = $profile ? $loyalty->summary($business, $profile) : null;
return view('customer.dashboard', [
'business' => $business,
'profile' => $profile,
'appointments' => $appointments,
'user' => $request->user(),
'loyaltySummary' => $loyaltySummary,
]);
}
}