Extract Ladill QR Plus as standalone app at qr.ladill.com.
Deploy Ladill QR Plus / deploy (push) Failing after 1s
Deploy Ladill QR Plus / deploy (push) Failing after 1s
Utility QR types only (URL, WiFi, link list, business, app download) with SSO, Billing API integration, public /q resolver, and qr-plus:import for platform migration. vCard and commerce types stay on the platform. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Qr;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\QrCode;
|
||||
use App\Services\Billing\BillingClient;
|
||||
use App\Services\Qr\QrCodeManagerService;
|
||||
use App\Support\Qr\QrTypeCatalog;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class OverviewController extends Controller
|
||||
{
|
||||
public function __construct(
|
||||
private QrCodeManagerService $manager,
|
||||
private BillingClient $billing,
|
||||
) {}
|
||||
|
||||
public function index(Request $request): View
|
||||
{
|
||||
$user = $request->user();
|
||||
$wallet = $this->manager->walletFor($user);
|
||||
$codes = $user->qrCodes()
|
||||
->whereIn('type', QrTypeCatalog::plusTypes())
|
||||
->latest()
|
||||
->limit(5)
|
||||
->get();
|
||||
|
||||
$activeCount = $user->qrCodes()
|
||||
->whereIn('type', QrTypeCatalog::plusTypes())
|
||||
->where('is_active', true)
|
||||
->count();
|
||||
|
||||
$scans30d = $user->qrCodes()
|
||||
->whereIn('type', QrTypeCatalog::plusTypes())
|
||||
->withSum(['scanEvents as scans_30d' => fn ($q) => $q->where('created_at', '>=', now()->subDays(30))], 'id')
|
||||
->get()
|
||||
->sum('scans_30d');
|
||||
|
||||
return view('qr.dashboard', [
|
||||
'wallet' => $wallet,
|
||||
'recentCodes' => $codes,
|
||||
'activeCount' => $activeCount,
|
||||
'scans30d' => (int) $scans30d,
|
||||
'balanceMinor' => $this->billing->balanceMinor($user->public_id),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user