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,21 @@
<?php
namespace App\Http\Controllers;
use App\Services\Loyalty\LoyaltyService;
use App\Services\Tenant\TenantContext;
use Illuminate\Http\Request;
use Illuminate\View\View;
class CustomerLoyaltyController extends Controller
{
public function __invoke(Request $request, TenantContext $tenant, LoyaltyService $loyalty): View
{
$business = $tenant->require();
$customer = $request->user()->customerProfiles()->where('businessId', $business->id)->firstOrFail();
$summary = $loyalty->summary($business, $customer);
$history = $customer->loyaltyAccounts()->with(['transactions' => fn ($query) => $query->latest('createdAt')->limit(20), 'programme'])->get()->flatMap->transactions->sortByDesc('createdAt')->take(20);
return view('customer.loyalty', compact('business', 'customer', 'summary', 'history'));
}
}