Add hero sections to Transfers and Files index pages.
Deploy Ladill Transfer / deploy (push) Successful in 31s
Deploy Ladill Transfer / deploy (push) Successful in 31s
Surface wallet balance and key stats at a glance, matching the layout used across other Ladill apps. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -25,6 +25,7 @@ class TransferController extends Controller
|
||||
private ChunkedUploadService $chunkedUploads,
|
||||
private QrImageGeneratorService $imageGenerator,
|
||||
private QrPdfExporter $pdfExporter,
|
||||
private BillingClient $billing,
|
||||
) {}
|
||||
|
||||
public function index(Request $request): View
|
||||
@@ -58,7 +59,34 @@ class TransferController extends Controller
|
||||
->paginate(20)
|
||||
->withQueryString();
|
||||
|
||||
return view('transfer.transfers.index', compact('transfers', 'search', 'status', 'sort'));
|
||||
$transferCount = Transfer::query()
|
||||
->where('user_id', $account->id)
|
||||
->shareTransfers()
|
||||
->where('status', '!=', Transfer::STATUS_DELETED)
|
||||
->count();
|
||||
|
||||
$activeCount = Transfer::query()
|
||||
->where('user_id', $account->id)
|
||||
->shareTransfers()
|
||||
->accessible()
|
||||
->count();
|
||||
|
||||
$balanceMinor = 0;
|
||||
try {
|
||||
$balanceMinor = $this->billing->balanceMinor($account->public_id);
|
||||
} catch (\Throwable) {
|
||||
// Balance is informational on this page.
|
||||
}
|
||||
|
||||
return view('transfer.transfers.index', compact(
|
||||
'transfers',
|
||||
'search',
|
||||
'status',
|
||||
'sort',
|
||||
'transferCount',
|
||||
'activeCount',
|
||||
'balanceMinor',
|
||||
));
|
||||
}
|
||||
|
||||
public function create(BillingClient $billing): View
|
||||
|
||||
Reference in New Issue
Block a user