<?phpuse Illuminate\Pagination\LengthAwarePaginator;use Livewire\Attributes\Computed;use Livewire\Component;use Livewire\WithPagination;new class extends Component { use WithPagination; #[Computed] public function statuses(): array { return [ ['label' => 'All', 'count' => 20], ['label' => 'Succeeded', 'count' => 12], ['label' => 'Refunded', 'count' => 2], ['label' => 'Disputed', 'count' => 1], ['label' => 'Failed', 'count' => 3], ['label' => 'Incomplete', 'count' => 2], ]; } #[Computed] public function transactions(): LengthAwarePaginator { return new LengthAwarePaginator(items: [ ['amount' => '$1,299.00', 'currency' => 'USD', 'status' => 'Succeeded', 'logo' => 'mastercard', 'method' => '•••• 4821', 'description' => 'Invoice #INV-2048', 'customer' => '[email protected]', 'company' => 'Northstar Labs', 'date' => 'Jul 18, 4:32 PM', 'refunded' => null, 'decline' => null, 'processor' => 'Stripe', 'fee' => '$37.97'], ['amount' => '$499.00', 'currency' => 'USD', 'status' => 'Succeeded', 'logo' => 'visa', 'method' => '•••• 1098', 'description' => 'Growth plan - Annual', 'customer' => '[email protected]', 'company' => null, 'date' => 'Jul 17, 11:14 AM', 'refunded' => null, 'decline' => null, 'processor' => 'Stripe', 'fee' => '$14.77'], ['amount' => '$2,500.00', 'currency' => 'USD', 'status' => 'Succeeded', 'logo' => 'bank', 'method' => 'Bank transfer', 'description' => 'Invoice #INV-2047', 'customer' => '[email protected]', 'company' => 'Evergreen Studio', 'date' => 'Jul 16, 2:48 PM', 'refunded' => null, 'decline' => null, 'processor' => 'ACH', 'fee' => '$5.00'], ['amount' => '$199.00', 'currency' => 'USD', 'status' => 'Incomplete', 'logo' => 'apple-pay', 'method' => 'Apple Pay', 'description' => 'Pro plan - Monthly', 'customer' => '[email protected]', 'company' => null, 'date' => 'Jul 15, 9:06 AM', 'refunded' => null, 'decline' => null, 'processor' => 'Stripe', 'fee' => null], ['amount' => '$799.00', 'currency' => 'USD', 'status' => 'Succeeded', 'logo' => 'visa', 'method' => '•••• 7742', 'description' => 'Invoice #INV-2046', 'customer' => '[email protected]', 'company' => 'Brightpath AI', 'date' => 'Jul 14, 5:27 PM', 'refunded' => null, 'decline' => null, 'processor' => 'Stripe', 'fee' => '$23.47'], ['amount' => '£149.00', 'currency' => 'GBP', 'status' => 'Succeeded', 'logo' => 'paypal', 'method' => 'PayPal', 'description' => 'Pro plan - Monthly', 'customer' => '[email protected]', 'company' => null, 'date' => 'Jul 13, 12:42 PM', 'refunded' => null, 'decline' => null, 'processor' => 'PayPal', 'fee' => '£5.69'], ['amount' => '$3,200.00', 'currency' => 'USD', 'status' => 'Succeeded', 'logo' => 'amex', 'method' => '•••• 3007', 'description' => 'Enterprise plan', 'customer' => '[email protected]', 'company' => 'Vertex Systems', 'date' => 'Jul 12, 3:19 PM', 'refunded' => null, 'decline' => null, 'processor' => 'Stripe', 'fee' => '$93.10'], ['amount' => '€1,250.00', 'currency' => 'EUR', 'status' => 'Failed', 'logo' => 'visa', 'method' => '•••• 9254', 'description' => 'Enterprise plan', 'customer' => '[email protected]', 'company' => 'Oak & Co.', 'date' => 'Jul 10, 4:03 PM', 'refunded' => null, 'decline' => 'Do not honor', 'processor' => 'Stripe', 'fee' => null], ['amount' => '$2,750.00', 'currency' => 'USD', 'status' => 'Disputed', 'logo' => 'amex', 'method' => '•••• 1045', 'description' => 'Enterprise plan', 'customer' => '[email protected]', 'company' => 'Clearframe', 'date' => 'Jul 6, 3:41 PM', 'refunded' => null, 'decline' => null, 'processor' => 'Stripe', 'fee' => '$80.05'], ['amount' => '$299.00', 'currency' => 'USD', 'status' => 'Refunded', 'logo' => 'paypal', 'method' => 'PayPal', 'description' => 'Pro plan - Monthly', 'customer' => '[email protected]', 'company' => null, 'date' => 'Jul 5, 10:15 AM', 'refunded' => 'Jul 6, 8:03 AM', 'decline' => null, 'processor' => 'PayPal', 'fee' => '$10.92'], ], total: 20, perPage: 10, currentPage: 1); }};?>{{-- This standalone demo keeps its application shell inline. In a production app, move shared navigation into your app layout. --}}<div> <flux:sidebar sticky collapsible persist="false" data-flux-sidebar-collapsed-desktop class="border-e border-zinc-200 bg-zinc-50 dark:border-zinc-700 dark:bg-zinc-900"> <flux:sidebar.header> <flux:sidebar.brand href="#" logo="https://fluxui.dev/img/demos/payments/logo.svg" logo:dark="https://fluxui.dev/img/demos/payments/logo-dark.svg" name="Arc" /> <flux:sidebar.collapse class="in-data-flux-sidebar-on-desktop:not-in-data-flux-sidebar-collapsed-desktop:-mr-2" /> </flux:sidebar.header> <flux:sidebar.nav> <flux:sidebar.item icon="home" href="#">Home</flux:sidebar.item> <flux:sidebar.item icon="arrows-right-left" href="#" current>Transactions</flux:sidebar.item> <flux:sidebar.item icon="users" href="#">Customers</flux:sidebar.item> <flux:sidebar.item icon="square-3-stack-3d" href="#">Product catalog</flux:sidebar.item> <flux:sidebar.item icon="chart-bar" href="#">Reporting</flux:sidebar.item> </flux:sidebar.nav> <flux:sidebar.nav> <flux:sidebar.group heading="Products"> <flux:sidebar.group expandable :expanded="false" heading="Billing"> <flux:sidebar.item href="#">Invoices</flux:sidebar.item> <flux:sidebar.item href="#">Subscriptions</flux:sidebar.item> <flux:sidebar.item href="#">Quotes</flux:sidebar.item> </flux:sidebar.group> <flux:sidebar.group expandable heading="Payments"> <flux:sidebar.item href="#">Dashboard</flux:sidebar.item> <flux:sidebar.item href="#">Balances</flux:sidebar.item> <flux:sidebar.item href="#">Payouts</flux:sidebar.item> <flux:sidebar.item href="#">Payment methods</flux:sidebar.item> <flux:sidebar.item href="#">Refunds</flux:sidebar.item> <flux:sidebar.item href="#">Disputes</flux:sidebar.item> </flux:sidebar.group> <flux:sidebar.group expandable :expanded="false" heading="More"> <flux:sidebar.item href="#">Tax</flux:sidebar.item> <flux:sidebar.item href="#">Fraud rules</flux:sidebar.item> <flux:sidebar.item href="#">Developers</flux:sidebar.item> </flux:sidebar.group> </flux:sidebar.group> </flux:sidebar.nav> <flux:sidebar.spacer /> <flux:sidebar.nav> <flux:sidebar.item icon="cog-6-tooth" href="#">Settings</flux:sidebar.item> </flux:sidebar.nav> </flux:sidebar> <flux:header class="border-b border-zinc-200 dark:border-zinc-700"> <flux:sidebar.toggle class="lg:hidden" icon="bars-2" inset="left" /> <flux:spacer /> <flux:field variant="inline"> <flux:label>Live mode</flux:label> <flux:switch checked /> </flux:field> <flux:navbar class="ms-2 me-1"> <flux:navbar.item icon="question-mark-circle" href="#" label="Help" aria-label="Help" /> <flux:navbar.item icon="bell" icon-dot href="#" label="Notifications" aria-label="Notifications" /> </flux:navbar> <flux:dropdown position="bottom" align="end"> <flux:profile avatar="https://fluxui.dev/img/demos/payments/avatar.jpg" circle :chevron="false" aria-label="Account menu" /> <flux:menu> <flux:menu.item icon="user">Profile</flux:menu.item> <flux:menu.item icon="cog-6-tooth">Settings</flux:menu.item> <flux:menu.separator /> <flux:menu.item icon="arrow-right-start-on-rectangle">Logout</flux:menu.item> </flux:menu> </flux:dropdown> </flux:header> {{-- Start the sidebar collapsed on desktop: rendered collapsed, then collapsed again as soon as Flux boots it... --}} <script>customElements.whenDefined('ui-sidebar').then(() => matchMedia('(min-width: 1024px)').matches && document.dispatchEvent(new Event('flux-sidebar-toggle')))</script> <flux:main class="flex flex-col gap-6"> <div class="flex flex-wrap items-center justify-between gap-4"> <flux:heading size="xl" level="1">Transactions</flux:heading> <div class="flex items-center gap-2"> <flux:button size="sm" icon="arrow-up-tray">Export</flux:button> <flux:button size="sm" variant="primary" icon="plus">Create payment</flux:button> </div> </div> <flux:tabs scrollable scrollable:scrollbar="hide"> <flux:tab name="payments" :accent="false" selected>Payments</flux:tab> <flux:tab name="payouts" :accent="false">Payouts</flux:tab> <flux:tab name="top-ups" :accent="false">Top-ups</flux:tab> <flux:tab name="analytics" :accent="false">Analytics</flux:tab> <flux:tab name="reports" :accent="false">Reports</flux:tab> </flux:tabs> <flux:radio.group variant="cards" aria-label="Payment status" class="flex-wrap"> @foreach ($this->statuses as $status) <flux:radio :value="$status['label']" :checked="$loop->first" class="min-w-32"> <div> <flux:text>{{ $status['label'] }}</flux:text> <flux:heading size="lg" class="mt-1">{{ $status['count'] }}</flux:heading> </div> </flux:radio> @endforeach </flux:radio.group> <div class="flex items-start justify-between gap-2"> <div class="flex flex-wrap items-center gap-2"> <flux:dropdown> <flux:button size="sm" variant="filled" icon="plus-circle">Date and time</flux:button> <flux:menu> <flux:menu.radio.group> <flux:menu.radio checked>All time</flux:menu.radio> <flux:menu.radio>Today</flux:menu.radio> <flux:menu.radio>Last 7 days</flux:menu.radio> <flux:menu.radio>Last 30 days</flux:menu.radio> <flux:menu.radio>Last 3 months</flux:menu.radio> </flux:menu.radio.group> </flux:menu> </flux:dropdown> <flux:dropdown> <flux:button size="sm" variant="filled" icon="plus-circle">Amount</flux:button> <flux:popover class="flex w-72 flex-col gap-4"> <flux:heading>Filter by amount</flux:heading> <div class="grid grid-cols-2 gap-4"> <flux:input size="sm" label="From" placeholder="$0" /> <flux:input size="sm" label="To" placeholder="$500" /> </div> <flux:button size="sm" variant="primary">Apply</flux:button> </flux:popover> </flux:dropdown> <flux:dropdown> <flux:button size="sm" variant="filled" icon="plus-circle">Currency</flux:button> <flux:menu> <flux:menu.checkbox>USD</flux:menu.checkbox> <flux:menu.checkbox>CAD</flux:menu.checkbox> <flux:menu.checkbox>GBP</flux:menu.checkbox> <flux:menu.checkbox>EUR</flux:menu.checkbox> <flux:menu.checkbox>JPY</flux:menu.checkbox> </flux:menu> </flux:dropdown> <flux:dropdown> <flux:button size="sm" variant="filled" icon="plus-circle">Status</flux:button> <flux:menu> <flux:menu.checkbox>Succeeded</flux:menu.checkbox> <flux:menu.checkbox>Refunded</flux:menu.checkbox> <flux:menu.checkbox>Disputed</flux:menu.checkbox> <flux:menu.checkbox>Failed</flux:menu.checkbox> <flux:menu.checkbox>Incomplete</flux:menu.checkbox> </flux:menu> </flux:dropdown> <flux:dropdown> <flux:button size="sm" variant="filled" icon="plus-circle">Payment method</flux:button> <flux:menu> <flux:menu.checkbox>Card</flux:menu.checkbox> <flux:menu.checkbox>PayPal</flux:menu.checkbox> <flux:menu.checkbox>Bank transfer</flux:menu.checkbox> <flux:menu.checkbox>Apple Pay</flux:menu.checkbox> <flux:menu.checkbox>Google Pay</flux:menu.checkbox> </flux:menu> </flux:dropdown> <flux:dropdown> <flux:button size="sm" variant="filled" icon="plus-circle">More filters</flux:button> <flux:menu> <flux:menu.item>Customer</flux:menu.item> <flux:menu.item>Description</flux:menu.item> <flux:menu.item>Card country</flux:menu.item> <flux:menu.item>Dispute reason</flux:menu.item> </flux:menu> </flux:dropdown> </div> <flux:dropdown align="end" class="max-sm:hidden"> <flux:button size="sm" icon="cog-6-tooth">Columns</flux:button> <flux:menu> <flux:menu.checkbox checked>Description</flux:menu.checkbox> <flux:menu.checkbox checked>Customer</flux:menu.checkbox> <flux:menu.checkbox checked>Company</flux:menu.checkbox> <flux:menu.checkbox checked>Date</flux:menu.checkbox> <flux:menu.checkbox checked>Refunded date</flux:menu.checkbox> <flux:menu.checkbox checked>Decline reason</flux:menu.checkbox> <flux:menu.checkbox checked>Processor</flux:menu.checkbox> <flux:menu.checkbox checked>Fees</flux:menu.checkbox> </flux:menu> </flux:dropdown> </div> <flux:checkbox.group> <flux:table :paginate="$this->transactions"> <flux:table.columns> <flux:table.column><flux:checkbox.all aria-label="Select all transactions" /></flux:table.column> <flux:table.column align="end">Amount</flux:table.column> <flux:table.column><span class="sr-only">Currency</span></flux:table.column> <flux:table.column>Status</flux:table.column> <flux:table.column>Payment method</flux:table.column> <flux:table.column>Description</flux:table.column> <flux:table.column>Customer</flux:table.column> <flux:table.column>Company</flux:table.column> <flux:table.column>Date</flux:table.column> <flux:table.column>Refunded date</flux:table.column> <flux:table.column>Decline reason</flux:table.column> <flux:table.column>Processor</flux:table.column> <flux:table.column>Fees</flux:table.column> <flux:table.column sticky class="bg-white dark:bg-zinc-800"></flux:table.column> </flux:table.columns> <flux:table.rows> @foreach ($this->transactions as $transaction) <flux:table.row> <flux:table.cell><flux:checkbox aria-label="Select {{ $transaction['description'] }}" /></flux:table.cell> <flux:table.cell variant="strong" align="end">{{ $transaction['amount'] }}</flux:table.cell> <flux:table.cell>{{ $transaction['currency'] }}</flux:table.cell> <flux:table.cell> <flux:badge size="sm" inset="top bottom" :color="match ($transaction['status']) { 'Succeeded' => 'lime', 'Refunded' => 'blue', 'Disputed' => 'orange', 'Failed' => 'red', default => 'zinc' }" :icon="match ($transaction['status']) { 'Succeeded' => 'check', 'Refunded' => 'arrow-path', 'Disputed' => 'exclamation-triangle', 'Failed' => 'x-mark', default => 'clock' }" >{{ $transaction['status'] }}</flux:badge> </flux:table.cell> <flux:table.cell> <div class="flex items-center gap-3"> <div @class([ 'flex h-6 w-8 shrink-0 items-center justify-center overflow-hidden rounded', 'bg-black' => in_array($transaction['logo'], ['mastercard', 'apple-pay']), 'bg-blue-800' => $transaction['logo'] === 'visa', 'bg-blue-600' => $transaction['logo'] === 'amex', 'border border-zinc-200 bg-white' => in_array($transaction['logo'], ['bank', 'paypal']), ])> @if ($transaction['logo'] === 'bank') <flux:icon.building-library variant="micro" class="text-zinc-500" /> @else <img src="https://fluxui.dev/img/demos/transactions/{{ $transaction['logo'] }}.svg" alt=""> @endif </div> {{ $transaction['method'] }} </div> </flux:table.cell> <flux:table.cell>{{ $transaction['description'] }}</flux:table.cell> <flux:table.cell>{{ $transaction['customer'] }}</flux:table.cell> <flux:table.cell>{{ $transaction['company'] ?? '—' }}</flux:table.cell> <flux:table.cell>{{ $transaction['date'] }}</flux:table.cell> <flux:table.cell>{{ $transaction['refunded'] ?? '—' }}</flux:table.cell> <flux:table.cell>{{ $transaction['decline'] ?? '—' }}</flux:table.cell> <flux:table.cell>{{ $transaction['processor'] }}</flux:table.cell> <flux:table.cell>{{ $transaction['fee'] ?? '—' }}</flux:table.cell> <flux:table.cell sticky class="bg-white dark:bg-zinc-800"> <flux:dropdown align="end"> <flux:button variant="ghost" size="sm" icon="ellipsis-horizontal" inset="top bottom" aria-label="Actions for {{ $transaction['description'] }}" /> <flux:menu> <flux:menu.item icon="eye">View details</flux:menu.item> <flux:menu.item icon="arrow-path">Refund payment</flux:menu.item> <flux:menu.item icon="envelope">Send receipt</flux:menu.item> <flux:menu.separator /> <flux:menu.item icon="flag">Report transaction</flux:menu.item> </flux:menu> </flux:dropdown> </flux:table.cell> </flux:table.row> @endforeach </flux:table.rows> </flux:table> </flux:checkbox.group> </flux:main></div>