server: laravel-boost

tool: search-docs

type: text

text:
# Search Results

## Components Input > As a button
Components Input | livewire/flux@2.x | Source: https://fluxui.dev/components/input#livewire/flux

As a button

To render an input using a button element, pass "button" into the as prop.

<flux:input as="button" placeholder="Search..." icon="magnifying-glass" kbd="⌘K" />

---

## Docs Dark Mode > JavaScript utilities
Docs Dark Mode | livewire/flux@2.x | Source: https://fluxui.dev/docs/dark-mode#livewire/flux

            JavaScript utilities

Managing dark mode in your own application is cumbersome. Here are a few essential behaviors you have to implement:

    Add/remove the .dark class to the  element

    Store the users preference in local storage

    Honor the system preference if system is selected

    Listen for changes in the system preference after a page has loaded

To save you from this complexity, Flux provides two JavaScript/Alpine utilities for making it easy to manage dark mode:

// Get/set a users color scheme preference...$flux.appearance = 'light|dark|system'// Get/set the current color scheme of your app...$flux.dark = 'true|false'

Given these two utilities, you can now use Alpine to easily build widgets to manage dark mode.

For example, here's how you would write a simple dark mode toggle button:

<flux:button x-data x-on:click="$flux.dark = ! $flux.dark">Toggle</flux:button>

Or if you wanted to allow a user to choose their preferred color scheme, you could write:

<flux:radio.group x-data x-model="$flux.appearance">    <flux:radio value="light">Light</flux:radio>    <flux:radio value="dark">Dark</flux:radio>    <flux:radio value="system">System</flux:radio></flux:radio.group>

If you want to use these utilities outside of Alpine, you can instead access .appearance and .dark on the global window.Flux JavaScript object from anywhere in your application:

let button = document.querySelector('...')button.addEventListener('click', () => {    Flux.dark = ! Flux.dark})

---

## Docs Dark Mode > Segmented radio
Docs Dark Mode | livewire/flux@2.x | Source: https://fluxui.dev/docs/dark-mode#livewire/flux

            Segmented radio

A simple toggle switch to allow users to control dark mode from something like a settings page.

<flux:radio.group x-data variant="segmented" x-model="$flux.appearance">    <flux:radio value="light" icon="sun">Light</flux:radio>    <flux:radio value="dark" icon="moon">Dark</flux:radio>    <flux:radio value="system" icon="computer-desktop">System</flux:radio></flux:radio.group>

Alternatively, you can use an icon-only variant to save horizontal space:

<flux:radio.group x-data variant="segmented" x-model="$flux.appearance">    <flux:radio value="light" icon="sun" />    <flux:radio value="dark" icon="moon" />    <flux:radio value="system" icon="computer-desktop" /></flux:radio.group>

---

## Docs Dark Mode > Toggle button
Docs Dark Mode | livewire/flux@2.x | Source: https://fluxui.dev/docs/dark-mode#livewire/flux

            Toggle button

A simple toggle button to allow uesrs to control dark mode from something like a navbar or sidebar.

<flux:button x-data x-on:click="$flux.dark = ! $flux.dark" icon="moon" variant="subtle" aria-label="Toggle dark mode" />

---

## Components Button > As an input
Components Button | livewire/flux@2.x | Source: https://fluxui.dev/components/button#livewire/flux

As an input

To display a button as an input, pass as="button" to the input component.

<flux:input as="button" placeholder="Search..." icon="magnifying-glass" kbd="⌘K" />

---

## Components Select > The button slot
Components Select | livewire/flux@2.x | Source: https://fluxui.dev/components/select#livewire/flux

            The button slot

If you need full control over the button used to trigger the custom select, you can use the button slot to render it yourself.

<flux:select variant="listbox">    <x-slot name="button">        <flux:select.button class="rounded-full!" placeholder="Choose industry..." :invalid="$errors->has('...')" />    </x-slot>    <flux:select.option>Photography</flux:select.option>    ...</flux:select>

---

## Docs Dark Mode > Toggle switch
Docs Dark Mode | livewire/flux@2.x | Source: https://fluxui.dev/docs/dark-mode#livewire/flux

            Toggle switch

A simple toggle switch to allow users to control dark mode from something like a settings page.

<flux:switch x-data x-model="$flux.dark" label="Dark mode"  />

---

## Components Input > With buttons
Components Input | livewire/flux@2.x | Source: https://fluxui.dev/components/input#livewire/flux

With buttons

Attach buttons to the beginning or end of an input element.

<flux:input.group>    <flux:input placeholder="Post title" />    <flux:button icon="plus">New post</flux:button></flux:input.group><flux:input.group>    <flux:select class="max-w-fit">        <flux:select.option selected>USD</flux:select.option>            </flux:select>    <flux:input placeholder="$99.99" /></flux:input.group>

---

## Docs Dark Mode > Dropdown menu
Docs Dark Mode | livewire/flux@2.x | Source: https://fluxui.dev/docs/dark-mode#livewire/flux

            Dropdown menu

More robust than a simple toggle button, this dropdown menu allows users to choose between light, dark, and system modes.

<flux:dropdown x-data align="end">    <flux:button variant="subtle" square class="group" aria-label="Preferred color scheme">        <flux:icon.sun x-show="$flux.appearance === 'light'" variant="mini" class="text-zinc-500 dark:text-white" />        <flux:icon.moon x-show="$flux.appearance === 'dark'" variant="mini" class="text-zinc-500 dark:text-white" />        <flux:icon.moon x-show="$flux.appearance === 'system' && $flux.dark" variant="mini" />        <flux:icon.sun x-show="$flux.appearance === 'system' && ! $flux.dark" variant="mini" />    </flux:button>    <flux:menu>        <flux:menu.item icon="sun" x-on:click="$flux.appearance = 'light'">Light</flux:menu.item>        <flux:menu.item icon="moon" x-on:click="$flux.appearance = 'dark'">Dark</flux:menu.item>        <flux:menu.item icon="computer-desktop" x-on:click="$flux.appearance = 'system'">System</flux:menu.item>    </flux:menu></flux:dropdown>

---

## Components Input > Icon buttons
Components Input | livewire/flux@2.x | Source: https://fluxui.dev/components/input#livewire/flux

Icon buttons

Append a button to the inside of an input to provide associated functionality.

<flux:input placeholder="Search orders">    <x-slot name="iconTrailing">        <flux:button size="sm" variant="subtle" icon="x-mark" class="-mr-1" />    </x-slot></flux:input><flux:input type="password" value="password">    <x-slot name="iconTrailing">        <flux:button size="sm" variant="subtle" icon="eye" class="-mr-1" />    </x-slot></flux:input>

---

## Components Field > With badge
Components Field | livewire/flux@2.x | Source: https://fluxui.dev/components/field#livewire/flux

With badge

Badges allow you to enhance a field with additional information such as being "required" or "optional" when it might not be expected.

<flux:field>    <flux:label badge="Required">Email</flux:label>    <flux:input type="email" required />    <flux:error name="email" /></flux:field><flux:field>    <flux:label badge="Optional">Phone number</flux:label>    <flux:input type="phone" placeholder="(555) 555-5555" mask="(999) 999-9999"  />    <flux:error name="phone" /></flux:field>

---

## Components Navbar > Navlist badges
Components Navbar | livewire/flux@2.x | Source: https://fluxui.dev/components/navbar#livewire/flux

Navlist badges

Show additional information related to a navlist item using the badge prop.

<flux:navlist class="w-64">    <flux:navlist.item href="#" icon="home">Home</flux:navlist.item>    <flux:navlist.item href="#" icon="envelope" badge="12">Inbox</flux:navlist.item>    <flux:navlist.item href="#" icon="user-group">Contacts</flux:navlist.item>    <flux:navlist.item href="#" icon="calendar-days" badge="Pro" badge:color="lime">Calendar</flux:navlist.item></flux:navlist>

_[Truncated]_


output:
Wall time: 2.5660 seconds
Output:
[{"type":"text","text":"# Search Results\n\n## Components Input > As a button\nComponents Input | livewire/flux@2.x | Source: https://fluxui.dev/components/input#livewire/flux\n\n
As a button

To render an input using a button element, pass \"button\" into the as prop.

<flux:input as=\"button\" placeholder=\"Search...\" icon=\"magnifying-glass\" kbd=\"⌘K\" />

\n\n---\n\n## Docs Dark Mode > JavaScript utilities\nDocs Dark Mode | livewire/flux@2.x | Source: https://fluxui.dev/docs/dark-mode#livewire/flux\n\n
\n            JavaScript utilities\n

Managing dark mode in your own application is cumbersome. Here are a few essential behaviors you have to implement:

\n    Add/remove the .dark class to the  element\n

\n    Store the users preference in local storage\n

\n    Honor the system preference if system is selected\n

\n    Listen for changes in the system preference after a page has loaded\n

To save you from this complexity, Flux provides two JavaScript/Alpine utilities for making it easy to manage dark mode:

// Get/set a users color scheme preference...$flux.appearance = 'light|dark|system'// Get/set the current color scheme of your app...$flux.dark = 'true|false'

Given these two utilities, you can now use Alpine to easily build widgets to manage dark mode.

For example, here's how you would write a simple dark mode toggle button:

<flux:button x-data x-on:click=\"$flux.dark = ! $flux.dark\">Toggle</flux:button>

Or if you wanted to allow a user to choose their preferred color scheme, you could write:

<flux:radio.group x-data x-model=\"$flux.appearance\">    <flux:radio value=\"light\">Light</flux:radio>    <flux:radio value=\"dark\">Dark</flux:radio>    <flux:radio value=\"system\">System</flux:radio></flux:radio.group>

If you want to use these utilities outside of Alpine, you can instead access .appearance and .dark on the global window.Flux JavaScript object from anywhere in your application:

let button = document.querySelector('...')button.addEventListener('click', () => {    Flux.dark = ! Flux.dark})

\n\n---\n\n## Docs Dark Mode > Segmented radio\nDocs Dark Mode | livewire/flux@2.x | Source: https://fluxui.dev/docs/dark-mode#livewire/flux\n\n
\n            Segmented radio\n

A simple toggle switch to allow users to control dark mode from something like a settings page.

<flux:radio.group x-data variant=\"segmented\" x-model=\"$flux.appearance\">    <flux:radio value=\"light\" icon=\"sun\">Light</flux:radio>    <flux:radio value=\"dark\" icon=\"moon\">Dark</flux:radio>    <flux:radio value=\"system\" icon=\"computer-desktop\">System</flux:radio></flux:radio.group>

Alternatively, you can use an icon-only variant to save horizontal space:

<flux:radio.group x-data variant=\"segmented\" x-model=\"$flux.appearance\">    <flux:radio value=\"light\" icon=\"sun\" />    <flux:radio value=\"dark\" icon=\"moon\" />    <flux:radio value=\"system\" icon=\"computer-desktop\" /></flux:radio.group>

\n\n---\n\n## Docs Dark Mode > Toggle button\nDocs Dark Mode | livewire/flux@2.x | Source: https://fluxui.dev/docs/dark-mode#livewire/flux\n\n
\n            Toggle button\n

A simple toggle button to allow uesrs to control dark mode from something like a navbar or sidebar.

<flux:button x-data x-on:click=\"$flux.dark = ! $flux.dark\" icon=\"moon\" variant=\"subtle\" aria-label=\"Toggle dark mode\" />

\n\n---\n\n## Components Button > As an input\nComponents Button | livewire/flux@2.x | Source: https://fluxui.dev/components/button#livewire/flux\n\n
As an input

To display a button as an input, pass as=\"button\" to the input component.

<flux:input as=\"button\" placeholder=\"Search...\" icon=\"magnifying-glass\" kbd=\"⌘K\" />

\n\n---\n\n## Components Select > The button slot\nComponents Select | livewire/flux@2.x | Source: https://fluxui.dev/components/select#livewire/flux\n\n
\n            The button slot\n

If you need full control over the button used to trigger the custom select, you can use the button slot to render it yourself.

<flux:select variant=\"listbox\">    <x-slot name=\"button\">        <flux:select.button class=\"rounded-full!\" placeholder=\"Choose industry...\" :invalid=\"$errors->has('...')\" />    </x-slot>    <flux:select.option>Photography</flux:select.option>    ...</flux:select>

\n\n---\n\n## Docs Dark Mode > Toggle switch\nDocs Dark Mode | livewire/flux@2.x | Source: https://fluxui.dev/docs/dark-mode#livewire/flux\n\n
\n            Toggle switch\n

A simple toggle switch to allow users to control dark mode from something like a settings page.

<flux:switch x-data x-model=\"$flux.dark\" label=\"Dark mode\"  />

\n\n---\n\n## Components Input > With buttons\nComponents Input | livewire/flux@2.x | Source: https://fluxui.dev/components/input#livewire/flux\n\n
With buttons

Attach buttons to the beginning or end of an input element.

<flux:input.group>    <flux:input placeholder=\"Post title\" />    <flux:button icon=\"plus\">New post</flux:button></flux:input.group><flux:input.group>    <flux:select class=\"max-w-fit\">        <flux:select.option selected>USD</flux:select.option>            </flux:select>    <flux:input placeholder=\"$99.99\" /></flux:input.group>

\n\n---\n\n## Docs Dark Mode > Dropdown menu\nDocs Dark Mode | livewire/flux@2.x | Source: https://fluxui.dev/docs/dark-mode#livewire/flux\n\n
\n            Dropdown menu\n

More robust than a simple toggle button, this dropdown menu allows users to choose between light, dark, and system modes.

<flux:dropdown x-data align=\"end\">    <flux:button variant=\"subtle\" square class=\"group\" aria-label=\"Preferred color scheme\">        <flux:icon.sun x-show=\"$flux.appearance === 'light'\" variant=\"mini\" class=\"text-zinc-500 dark:text-white\" />        <flux:icon.moon x-show=\"$flux.appearance === 'dark'\" variant=\"mini\" class=\"text-zinc-500 dark:text-white\" />        <flux:icon.moon x-show=\"$flux.appearance === 'system' && $flux.dark\" variant=\"mini\" />        <flux:icon.sun x-show=\"$flux.appearance === 'system' && ! $flux.dark\" variant=\"mini\" />    </flux:button>    <flux:menu>        <flux:menu.item icon=\"sun\" x-on:click=\"$flux.appearance = 'light'\">Light</flux:menu.item>        <flux:menu.item icon=\"moon\" x-on:click=\"$flux.appearance = 'dark'\">Dark</flux:menu.item>        <flux:menu.item icon=\"computer-desktop\" x-on:click=\"$flux.appearance = 'system'\">System</flux:menu.item>    </flux:menu></flux:dropdown>

\n\n---\n\n## Components Input > Icon buttons\nComponents Input | livewire/flux@2.x | Source: https://fluxui.dev/components/input#livewire/flux\n\n
Icon buttons

Append a button to the inside of an input to provide associated functionality.

<flux:input placeholder=\"Search orders\">    <x-slot name=\"iconTrailing\">        <flux:button size=\"sm\" variant=\"subtle\" icon=\"x-mark\" class=\"-mr-1\" />    </x-slot></flux:input><flux:input type=\"password\" value=\"password\">    <x-slot name=\"iconTrailing\">        <flux:button size=\"sm\" variant=\"subtle\" icon=\"eye\" class=\"-mr-1\" />    </x-slot></flux:input>

\n\n---\n\n## Components Field > With badge\nComponents Field | livewire/flux@2.x | Source: https://fluxui.dev/components/field#livewire/flux\n\n
With badge

Badges allow you to enhance a field with additional information such as being \"required\" or \"optional\" when it might not be expected.

<flux:field>    <flux:label badge=\"Required\">Email</flux:label>    <flux:input type=\"email\" required />    <flux:error name=\"email\" /></flux:field><flux:field>    <flux:label badge=\"Optional\">Phone number</flux:label>    <flux:input type=\"phone\" placeholder=\"(555) 555-5555\" mask=\"(999) 999-9999\"  />    <flux:error name=\"phone\" /></flux:field>

\n\n---\n\n## Components Navbar > Navlist badges\nComponents Navbar | livewire/flux@2.x | Source: https://fluxui.dev/components/navbar#livewire/flux\n\n
Navlist badges

Show additional information related to a navlist item using the badge prop.

<flux:navlist class=\"w-64\">    <flux:navlist.item href=\"#\" icon=\"home\">Home</flux:navlist.item>    <flux:navlist.item href=\"#\" icon=\"envelope\" badge=\"12\">Inbox</flux:navlist.item>    <flux:navlist.item href=\"#\" icon=\"user-group\">Contacts</flux:navlist.item>    <flux:navlist.item href=\"#\" icon=\"calendar-days\" badge=\"Pro\" badge:color=\"lime\">Calendar</flux:navlist.item></flux:navlist>

\n\n_[Truncated]_"}]


cmd: find resources/views/components -maxdepth 3 -type f | sort | sed -n '1,200p'


cmd: sed -n '1,220p' resources/views/layouts/storefront.blade.php


cmd: rg "account\.dashboard|account\.login|customer" -n resources/views/components resources/views/layouts resources/views/livewire/storefront | sed -n '1,240p'


command: sed -n '1,220p' resources/views/layouts/storefront.blade.php

storefront.blade.php

type: read

aggregated_output:
<!DOCTYPE html>
getLocale()) }}">

        @include('partials.head')

        @php($store = app()->bound('current_store') ? app('current_store') : null)
        @php($announcement = data_get($themeSettings ?? [], 'announcement', []))
        @php($mainLinks = ($mainNavigation ?? []) !== [] ? $mainNavigation : [['label' => 'Collections', 'url' => route('collections.index'), 'external' => false], ['label' => 'Search', 'url' => route('search.index'), 'external' => false]])
        @php($footerLinks = ($footerNavigation ?? []) !== [] ? $footerNavigation : [['label' => 'Collections', 'url' => route('collections.index'), 'external' => false], ['label' => 'Search', 'url' => route('search.index'), 'external' => false]])

            Skip to main content

        @if (data_get($announcement, 'enabled', false))

                @if (data_get($announcement, 'url'))

                        {{ data_get($announcement, 'text') }}

                @else
                    {{ data_get($announcement, 'text') }}
                @endif

        @endif

         data_get($themeSettings ?? [], 'header.sticky', true),
        ])>

                    {{ $store?->name ?? config('app.name') }}

                    @foreach ($mainLinks as $item)
                        @if (($item['children'] ?? []) !== [])

                                    {{ $item['label'] }}
                                    <flux:icon name="chevron-down" class="size-4" />

                                    @foreach ($item['children'] as $child)

                                            {{ $child['label'] }}

                                    @endforeach

                        @else

                                {{ $item['label'] }}

                        @endif
                    @endforeach

                    <flux:button :href="route('search.index')" wire:navigate variant="subtle" icon="magnifying-glass" aria-label="Search" />
                    <flux:button :href="route('account.dashboard')" wire:navigate variant="subtle" icon="user" aria-label="Account" />
                    <flux:modal.trigger name="cart-drawer">
                        <flux:button variant="subtle" icon="shopping-bag" aria-label="Cart" />
                    </flux:modal.trigger>

        <livewire:storefront.cart-drawer />

            {{ $slot }}

{{ $store?->name ?? config('app.name') }}

{{ data_get($themeSettings ?? [], 'footer.tagline') }}

Shop

                        @foreach ($footerLinks as $item)

                                {{ $item['label'] }}

                            @foreach (($item['children'] ?? []) as $child)

                                    {{ $child['label'] }}

                            @endforeach
                        @endforeach

Customer

                        Account
                        About

        @fluxScripts

status: completed


command: find resources/views/components -maxdepth 3 -type f | sort | sed -n '1,200p'

path: components


output:
Chunk ID: e6c1f3
Wall time: 0.0000 seconds
Process exited with code 0
Original token count: 149
Output:
resources/views/components/action-message.blade.php
resources/views/components/app-logo-icon.blade.php
resources/views/components/app-logo.blade.php
resources/views/components/auth-header.blade.php
resources/views/components/auth-session-status.blade.php
resources/views/components/desktop-user-menu.blade.php
resources/views/components/placeholder-pattern.blade.php
resources/views/components/settings/layout.blade.php
resources/views/components/storefront/breadcrumbs.blade.php
resources/views/components/storefront/price.blade.php
resources/views/components/storefront/product-card.blade.php


output:
Chunk ID: 3adc86
Wall time: 0.0000 seconds
Process exited with code 0
Original token count: 1752
Output:
<!DOCTYPE html>
getLocale()) }}">

        @include('partials.head')

        @php($store = app()->bound('current_store') ? app('current_store') : null)
        @php($announcement = data_get($themeSettings ?? [], 'announcement', []))
        @php($mainLinks = ($mainNavigation ?? []) !== [] ? $mainNavigation : [['label' => 'Collections', 'url' => route('collections.index'), 'external' => false], ['label' => 'Search', 'url' => route('search.index'), 'external' => false]])
        @php($footerLinks = ($footerNavigation ?? []) !== [] ? $footerNavigation : [['label' => 'Collections', 'url' => route('collections.index'), 'external' => false], ['label' => 'Search', 'url' => route('search.index'), 'external' => false]])

            Skip to main content

        @if (data_get($announcement, 'enabled', false))

                @if (data_get($announcement, 'url'))

                        {{ data_get($announcement, 'text') }}

                @else
                    {{ data_get($announcement, 'text') }}
                @endif

        @endif

         data_get($themeSettings ?? [], 'header.sticky', true),
        ])>

                    {{ $store?->name ?? config('app.name') }}

                    @foreach ($mainLinks as $item)
                        @if (($item['children'] ?? []) !== [])

                                    {{ $item['label'] }}
                                    <flux:icon name="chevron-down" class="size-4" />

                                    @foreach ($item['children'] as $child)

                                            {{ $child['label'] }}

                                    @endforeach

                        @else

                                {{ $item['label'] }}

                        @endif
                    @endforeach

                    <flux:button :href="route('search.index')" wire:navigate variant="subtle" icon="magnifying-glass" aria-label="Search" />
                    <flux:button :href="route('account.dashboard')" wire:navigate variant="subtle" icon="user" aria-label="Account" />
                    <flux:modal.trigger name="cart-drawer">
                        <flux:button variant="subtle" icon="shopping-bag" aria-label="Cart" />
                    </flux:modal.trigger>

        <livewire:storefront.cart-drawer />

            {{ $slot }}

{{ $store?->name ?? config('app.name') }}

{{ data_get($themeSettings ?? [], 'footer.tagline') }}

Shop

                        @foreach ($footerLinks as $item)

                                {{ $item['label'] }}

                            @foreach (($item['children'] ?? []) as $child)

                                    {{ $child['label'] }}

                            @endforeach
                        @endforeach

Customer

                        Account
                        About

        @fluxScripts


command: rg "account\.dashboard|account\.login|customer" -n resources/views/components resources/views/layouts resources/views/livewire/storefront | sed -n '1,240p'

type: search

cmd: rg "account\\.dashboard|account\\.login|customer" -n resources/views/components resources/views/layouts resources/views/livewire/storefront

query: account\.dashboard|account\.login|customer

path: components

aggregated_output:
resources/views/livewire/storefront/account/orders/show.blade.php:3:        ['label' => 'Account', 'url' => route('account.dashboard')],
resources/views/layouts/storefront.blade.php:64:                    <flux:button :href="route('account.dashboard')" wire:navigate variant="subtle" icon="user" aria-label="Account" />
resources/views/layouts/storefront.blade.php:104:                        Account
resources/views/layouts/app/sidebar.blade.php:53:                    <flux:sidebar.item icon="users" :href="route('admin.customers.index')" :current="request()->routeIs('admin.customers.*')" wire:navigate>
resources/views/livewire/storefront/account/auth/login.blade.php:12:            placeholder="customer@acme.test"
resources/views/livewire/storefront/account/auth/login.blade.php:26:            <flux:link :href="route('customer.password.request')" wire:navigate>{{ __('Forgot your password?') }}</flux:link>
resources/views/livewire/storefront/account/auth/login.blade.php:31:        <flux:button variant="primary" type="submit" class="w-full" data-test="customer-login-button">
resources/views/livewire/storefront/account/auth/login.blade.php:37:        {{ __('New customer?') }}
resources/views/livewire/storefront/account/auth/forgot-password.blade.php:18:            placeholder="customer@acme.test"
resources/views/livewire/storefront/account/auth/forgot-password.blade.php:21:        <flux:button variant="primary" type="submit" class="w-full" data-test="customer-forgot-password-button">
resources/views/livewire/storefront/account/auth/forgot-password.blade.php:27:        <flux:link :href="route('account.login')" wire:navigate>{{ __('Back to log in') }}</flux:link>
resources/views/livewire/storefront/account/auth/register.blade.php:20:            placeholder="customer@acme.test"
resources/views/livewire/storefront/account/auth/register.blade.php:43:        <flux:button variant="primary" type="submit" class="w-full" data-test="customer-register-button">
resources/views/livewire/storefront/account/auth/register.blade.php:50:        <flux:link :href="route('account.login')" wire:navigate>{{ __('Log in') }}</flux:link>
resources/views/livewire/storefront/account/auth/reset-password.blade.php:12:            placeholder="customer@acme.test"
resources/views/livewire/storefront/account/auth/reset-password.blade.php:33:        <flux:button variant="primary" type="submit" class="w-full" data-test="customer-reset-password-button">
resources/views/livewire/storefront/account/auth/reset-password.blade.php:39:        <flux:link :href="route('account.login')" wire:navigate>{{ __('Back to log in') }}</flux:link>


output:
Chunk ID: 394bf8
Wall time: 0.0000 seconds
Process exited with code 0
Original token count: 676
Output:
resources/views/livewire/storefront/account/orders/show.blade.php:3:        ['label' => 'Account', 'url' => route('account.dashboard')],
resources/views/layouts/storefront.blade.php:64:                    <flux:button :href="route('account.dashboard')" wire:navigate variant="subtle" icon="user" aria-label="Account" />
resources/views/layouts/storefront.blade.php:104:                        Account
resources/views/layouts/app/sidebar.blade.php:53:                    <flux:sidebar.item icon="users" :href="route('admin.customers.index')" :current="request()->routeIs('admin.customers.*')" wire:navigate>
resources/views/livewire/storefront/account/auth/login.blade.php:12:            placeholder="customer@acme.test"
resources/views/livewire/storefront/account/auth/login.blade.php:26:            <flux:link :href="route('customer.password.request')" wire:navigate>{{ __('Forgot your password?') }}</flux:link>
resources/views/livewire/storefront/account/auth/login.blade.php:31:        <flux:button variant="primary" type="submit" class="w-full" data-test="customer-login-button">
resources/views/livewire/storefront/account/auth/login.blade.php:37:        {{ __('New customer?') }}
resources/views/livewire/storefront/account/auth/forgot-password.blade.php:18:            placeholder="customer@acme.test"
resources/views/livewire/storefront/account/auth/forgot-password.blade.php:21:        <flux:button variant="primary" type="submit" class="w-full" data-test="customer-forgot-password-button">
resources/views/livewire/storefront/account/auth/forgot-password.blade.php:27:        <flux:link :href="route('account.login')" wire:navigate>{{ __('Back to log in') }}</flux:link>
resources/views/livewire/storefront/account/auth/register.blade.php:20:            placeholder="customer@acme.test"
resources/views/livewire/storefront/account/auth/register.blade.php:43:        <flux:button variant="primary" type="submit" class="w-full" data-test="customer-register-button">
resources/views/livewire/storefront/account/auth/register.blade.php:50:        <flux:link :href="route('account.login')" wire:navigate>{{ __('Log in') }}</flux:link>
resources/views/livewire/storefront/account/auth/reset-password.blade.php:12:            placeholder="customer@acme.test"
resources/views/livewire/storefront/account/auth/reset-password.blade.php:33:        <flux:button variant="primary" type="submit" class="w-full" data-test="customer-reset-password-button">
resources/views/livewire/storefront/account/auth/reset-password.blade.php:39:        <flux:link :href="route('account.login')" wire:navigate>{{ __('Back to log in') }}</flux:link>


cmd: sed -n '1,260p' tests/Feature/Foundation/TenancyTest.php


cmd: rg "HTTP_HOST|shop.test|withServerVariables|from\('/account" -n tests/Feature | sed -n '1,240p'


command: sed -n '1,260p' tests/Feature/Foundation/TenancyTest.php

aggregated_output:
<?php

use App\Livewire\Admin\Auth\Login as AdminLogin;
use App\Models\Store;
use App\Models\StoreDomain;
use App\Models\User;
use Database\Seeders\DatabaseSeeder;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Schema;
use Livewire\Livewire;

uses(RefreshDatabase::class);

test('phase one tables and seeded tenant records exist', function () {
    $this->seed(DatabaseSeeder::class);

    expect(Schema::hasColumns('organizations', ['name', 'billing_email']))->toBeTrue()
        ->and(Schema::hasColumns('stores', ['organization_id', 'handle', 'status', 'default_currency']))->toBeTrue()
        ->and(Schema::hasColumns('store_domains', ['store_id', 'hostname', 'type', 'is_primary']))->toBeTrue()
        ->and(Schema::hasColumns('store_users', ['store_id', 'user_id', 'role']))->toBeTrue()
        ->and(Schema::hasColumns('store_settings', ['store_id', 'settings_json']))->toBeTrue()
        ->and(StoreDomain::query()->where('hostname', 'shop.test')->exists())->toBeTrue()
        ->and(User::query()->where('email', 'admin@acme.test')->exists())->toBeTrue();
});

test('storefront requests resolve a store by hostname', function () {
    $this->seed(DatabaseSeeder::class);

    $this->get('http://shop.test/')
        ->assertOk();
});

test('storefront requests reject unknown or suspended stores', function () {
    $this->seed(DatabaseSeeder::class);

    $this->get('http://unknown-shop.test/')
        ->assertNotFound();

    $store = Store::factory()->suspended()->create();
    StoreDomain::factory()->create([
        'store_id' => $store->getKey(),
        'hostname' => 'suspended-shop.test',
    ]);

    $this->get('http://suspended-shop.test/')
        ->assertServiceUnavailable();
});

test('admin requests resolve the selected session store for authorized staff', function () {
    $this->seed(DatabaseSeeder::class);

    $user = User::query()->where('email', 'admin@acme.test')->firstOrFail();
    $store = Store::query()->where('handle', 'acme-fashion')->firstOrFail();

    $this->actingAs($user)
        ->withSession(['current_store_id' => $store->getKey()])
        ->get('/admin')
        ->assertOk();
});

test('admin login component authenticates active staff with a generic failure message', function () {
    $this->seed(DatabaseSeeder::class);

    Livewire::test(AdminLogin::class)
        ->set('email', 'admin@acme.test')
        ->set('password', 'wrong-password')
        ->call('login')
        ->assertHasErrors(['email']);

    Livewire::test(AdminLogin::class)
        ->set('email', 'admin@acme.test')
        ->set('password', 'password')
        ->call('login')
        ->assertHasNoErrors()
        ->assertRedirect(route('admin.dashboard', absolute: false));

    $this->assertAuthenticated();
});


command: rg "HTTP_HOST|shop.test|withServerVariables|from\('/account" -n tests/Feature | sed -n '1,240p'

type: search

cmd: rg "HTTP_HOST|shop.test|withServerVariables|from\\('/account" -n tests/Feature

query: HTTP_HOST|shop.test|withServerVariables|from\('/account

path: Feature

aggregated_output:
tests/Feature/Foundation/TenancyTest.php:22:        ->and(StoreDomain::query()->where('hostname', 'shop.test')->exists())->toBeTrue()
tests/Feature/Foundation/TenancyTest.php:29:    $this->get('http://shop.test/')
tests/Feature/Foundation/TenancyTest.php:36:    $this->get('http://unknown-shop.test/')
tests/Feature/Foundation/TenancyTest.php:42:        'hostname' => 'suspended-shop.test',
tests/Feature/Foundation/TenancyTest.php:45:    $this->get('http://suspended-shop.test/')
tests/Feature/Api/StorefrontCheckoutApiTest.php:67:    $api = fn () => $this->withServerVariables(['REMOTE_ADDR' => '10.0.0.21'])->withHeader('Host', 'shop.test');
tests/Feature/Api/StorefrontCheckoutApiTest.php:147:    $api = fn () => $this->withServerVariables(['REMOTE_ADDR' => '10.0.0.22'])->withHeader('Host', 'shop.test');
tests/Feature/Api/StorefrontSearchApiTest.php:55:    $this->withHeader('Host', 'shop.test')
tests/Feature/Api/StorefrontSearchApiTest.php:69:    $this->withHeader('Host', 'shop.test')
tests/Feature/Api/StorefrontSearchApiTest.php:75:    $this->withHeader('Host', 'shop.test')
tests/Feature/Api/StorefrontSearchApiTest.php:80:    $this->withHeader('Host', 'shop.test')
tests/Feature/Api/StorefrontSearchApiTest.php:99:    $this->withHeader('Host', 'shop.test')
tests/Feature/Api/StorefrontSearchApiTest.php:125:    $response = $this->withHeader('Host', 'shop.test')
tests/Feature/Storefront/ThemeDataTest.php:127:    $this->withHeader('Host', 'shop.test')
tests/Feature/Storefront/ThemeDataTest.php:133:    $this->withHeader('Host', 'shop.test')
tests/Feature/ExampleTest.php:11:    $response = $this->get('http://shop.test/');
tests/Feature/Api/StorefrontCartApiTest.php:48:    $response = $this->withHeader('Host', 'shop.test')
tests/Feature/Api/StorefrontCartApiTest.php:60:    $this->withHeader('Host', 'shop.test')
tests/Feature/Api/StorefrontCartApiTest.php:71:    $cartId = $this->withHeader('Host', 'shop.test')
tests/Feature/Api/StorefrontCartApiTest.php:75:    $addResponse = $this->withHeader('Host', 'shop.test')
tests/Feature/Api/StorefrontCartApiTest.php:90:    $this->withHeader('Host', 'shop.test')
tests/Feature/Api/StorefrontCartApiTest.php:100:    $this->withHeader('Host', 'shop.test')
tests/Feature/Api/StorefrontCartApiTest.php:116:    $cartId = $this->withHeader('Host', 'shop.test')
tests/Feature/Api/StorefrontCartApiTest.php:120:    $lineId = $this->withHeader('Host', 'shop.test')
tests/Feature/Api/StorefrontCartApiTest.php:127:    $this->withHeader('Host', 'shop.test')
tests/Feature/Api/StorefrontCartApiTest.php:142:    $this->withHeader('Host', 'shop.test')
tests/Feature/Api/StorefrontCartApiTest.php:147:    $this->withHeader('Host', 'shop.test')
tests/Feature/Api/StorefrontCartApiTest.php:153:    $this->withHeader('Host', 'shop.test')
tests/Feature/Api/StorefrontOrderApiTest.php:53:    $api = fn () => $testCase->withServerVariables(['REMOTE_ADDR' => $remoteAddress])->withHeader('Host', 'shop.test');
tests/Feature/Api/StorefrontOrderApiTest.php:97:    $api = fn () => $this->withServerVariables(['REMOTE_ADDR' => '10.0.0.41'])->withHeader('Host', 'shop.test');
tests/Feature/Api/StorefrontOrderApiTest.php:129:    $api = fn () => $this->withServerVariables(['REMOTE_ADDR' => '10.0.0.42'])->withHeader('Host', 'shop.test');
tests/Feature/Admin/SettingsManagementTest.php:151:        ->set('termsUrl', 'https://shop.test/pages/terms')
tests/Feature/Admin/SettingsManagementTest.php:166:        ->and(data_get($settings, 'checkout.terms_url'))->toBe('https://shop.test/pages/terms')
tests/Feature/Admin/SettingsManagementTest.php:179:        ->set('senderEmail', 'ops@shop.test')
tests/Feature/Admin/SettingsManagementTest.php:180:        ->set('replyToEmail', 'support@shop.test')
tests/Feature/Admin/SettingsManagementTest.php:193:        ->and(data_get($settings, 'notifications.sender_email'))->toBe('ops@shop.test')
tests/Feature/Admin/SettingsManagementTest.php:194:        ->and(data_get($settings, 'notifications.reply_to_email'))->toBe('support@shop.test')
tests/Feature/Api/StorefrontAnalyticsApiTest.php:37:    $this->withHeader('Host', 'shop.test')
tests/Feature/Api/StorefrontAnalyticsApiTest.php:43:    $this->withHeader('Host', 'shop.test')
tests/Feature/Api/StorefrontAnalyticsApiTest.php:55:    $this->withHeader('Host', 'shop.test')
tests/Feature/Api/StorefrontAnalyticsApiTest.php:62:    $this->withHeader('Host', 'shop.test')
tests/Feature/Catalog/CatalogUiTest.php:23:    $this->withHeader('Host', 'shop.test')
tests/Feature/Catalog/CatalogUiTest.php:30:    $this->withHeader('Host', 'shop.test')
tests/Feature/Catalog/CatalogUiTest.php:37:    $this->withHeader('Host', 'shop.test')
tests/Feature/Catalog/CatalogUiTest.php:45:    $this->withHeader('Host', 'shop.test')
tests/Feature/Api/AdminStoreSettingsApiTest.php:73:        ->assertJsonPath('data.settings_json.notifications.sender_email', 'no-reply@shop.test');
tests/Feature/Api/AdminStoreSettingsApiTest.php:81:        ->and($settings->settings_json['notifications']['sender_email'])->toBe('no-reply@shop.test');


output:
Chunk ID: 159ea7
Wall time: 0.0000 seconds
Process exited with code 0
Original token count: 697
Output:
<?php

use App\Livewire\Admin\Auth\Login as AdminLogin;
use App\Models\Store;
use App\Models\StoreDomain;
use App\Models\User;
use Database\Seeders\DatabaseSeeder;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Schema;
use Livewire\Livewire;

uses(RefreshDatabase::class);

test('phase one tables and seeded tenant records exist', function () {
    $this->seed(DatabaseSeeder::class);

    expect(Schema::hasColumns('organizations', ['name', 'billing_email']))->toBeTrue()
        ->and(Schema::hasColumns('stores', ['organization_id', 'handle', 'status', 'default_currency']))->toBeTrue()
        ->and(Schema::hasColumns('store_domains', ['store_id', 'hostname', 'type', 'is_primary']))->toBeTrue()
        ->and(Schema::hasColumns('store_users', ['store_id', 'user_id', 'role']))->toBeTrue()
        ->and(Schema::hasColumns('store_settings', ['store_id', 'settings_json']))->toBeTrue()
        ->and(StoreDomain::query()->where('hostname', 'shop.test')->exists())->toBeTrue()
        ->and(User::query()->where('email', 'admin@acme.test')->exists())->toBeTrue();
});

test('storefront requests resolve a store by hostname', function () {
    $this->seed(DatabaseSeeder::class);

    $this->get('http://shop.test/')
        ->assertOk();
});

test('storefront requests reject unknown or suspended stores', function () {
    $this->seed(DatabaseSeeder::class);

    $this->get('http://unknown-shop.test/')
        ->assertNotFound();

    $store = Store::factory()->suspended()->create();
    StoreDomain::factory()->create([
        'store_id' => $store->getKey(),
        'hostname' => 'suspended-shop.test',
    ]);

    $this->get('http://suspended-shop.test/')
        ->assertServiceUnavailable();
});

test('admin requests resolve the selected session store for authorized staff', function () {
    $this->seed(DatabaseSeeder::class);

    $user = User::query()->where('email', 'admin@acme.test')->firstOrFail();
    $store = Store::query()->where('handle', 'acme-fashion')->firstOrFail();

    $this->actingAs($user)
        ->withSession(['current_store_id' => $store->getKey()])
        ->get('/admin')
        ->assertOk();
});

test('admin login component authenticates active staff with a generic failure message', function () {
    $this->seed(DatabaseSeeder::class);

    Livewire::test(AdminLogin::class)
        ->set('email', 'admin@acme.test')
        ->set('password', 'wrong-password')
        ->call('login')
        ->assertHasErrors(['email']);

    Livewire::test(AdminLogin::class)
        ->set('email', 'admin@acme.test')
        ->set('password', 'password')
        ->call('login')
        ->assertHasNoErrors()
        ->assertRedirect(route('admin.dashboard', absolute: false));

    $this->assertAuthenticated();
});


output:
Chunk ID: e6c0c1
Wall time: 0.0000 seconds
Process exited with code 0
Original token count: 1260
Output:
tests/Feature/Foundation/TenancyTest.php:22:        ->and(StoreDomain::query()->where('hostname', 'shop.test')->exists())->toBeTrue()
tests/Feature/Foundation/TenancyTest.php:29:    $this->get('http://shop.test/')
tests/Feature/Foundation/TenancyTest.php:36:    $this->get('http://unknown-shop.test/')
tests/Feature/Foundation/TenancyTest.php:42:        'hostname' => 'suspended-shop.test',
tests/Feature/Foundation/TenancyTest.php:45:    $this->get('http://suspended-shop.test/')
tests/Feature/Api/StorefrontCheckoutApiTest.php:67:    $api = fn () => $this->withServerVariables(['REMOTE_ADDR' => '10.0.0.21'])->withHeader('Host', 'shop.test');
tests/Feature/Api/StorefrontCheckoutApiTest.php:147:    $api = fn () => $this->withServerVariables(['REMOTE_ADDR' => '10.0.0.22'])->withHeader('Host', 'shop.test');
tests/Feature/Api/StorefrontSearchApiTest.php:55:    $this->withHeader('Host', 'shop.test')
tests/Feature/Api/StorefrontSearchApiTest.php:69:    $this->withHeader('Host', 'shop.test')
tests/Feature/Api/StorefrontSearchApiTest.php:75:    $this->withHeader('Host', 'shop.test')
tests/Feature/Api/StorefrontSearchApiTest.php:80:    $this->withHeader('Host', 'shop.test')
tests/Feature/Api/StorefrontSearchApiTest.php:99:    $this->withHeader('Host', 'shop.test')
tests/Feature/Api/StorefrontSearchApiTest.php:125:    $response = $this->withHeader('Host', 'shop.test')
tests/Feature/Storefront/ThemeDataTest.php:127:    $this->withHeader('Host', 'shop.test')
tests/Feature/Storefront/ThemeDataTest.php:133:    $this->withHeader('Host', 'shop.test')
tests/Feature/ExampleTest.php:11:    $response = $this->get('http://shop.test/');
tests/Feature/Api/StorefrontCartApiTest.php:48:    $response = $this->withHeader('Host', 'shop.test')
tests/Feature/Api/StorefrontCartApiTest.php:60:    $this->withHeader('Host', 'shop.test')
tests/Feature/Api/StorefrontCartApiTest.php:71:    $cartId = $this->withHeader('Host', 'shop.test')
tests/Feature/Api/StorefrontCartApiTest.php:75:    $addResponse = $this->withHeader('Host', 'shop.test')
tests/Feature/Api/StorefrontCartApiTest.php:90:    $this->withHeader('Host', 'shop.test')
tests/Feature/Api/StorefrontCartApiTest.php:100:    $this->withHeader('Host', 'shop.test')
tests/Feature/Api/StorefrontCartApiTest.php:116:    $cartId = $this->withHeader('Host', 'shop.test')
tests/Feature/Api/StorefrontCartApiTest.php:120:    $lineId = $this->withHeader('Host', 'shop.test')
tests/Feature/Api/StorefrontCartApiTest.php:127:    $this->withHeader('Host', 'shop.test')
tests/Feature/Api/StorefrontCartApiTest.php:142:    $this->withHeader('Host', 'shop.test')
tests/Feature/Api/StorefrontCartApiTest.php:147:    $this->withHeader('Host', 'shop.test')
tests/Feature/Api/StorefrontCartApiTest.php:153:    $this->withHeader('Host', 'shop.test')
tests/Feature/Api/StorefrontOrderApiTest.php:53:    $api = fn () => $testCase->withServerVariables(['REMOTE_ADDR' => $remoteAddress])->withHeader('Host', 'shop.test');
tests/Feature/Api/StorefrontOrderApiTest.php:97:    $api = fn () => $this->withServerVariables(['REMOTE_ADDR' => '10.0.0.41'])->withHeader('Host', 'shop.test');
tests/Feature/Api/StorefrontOrderApiTest.php:129:    $api = fn () => $this->withServerVariables(['REMOTE_ADDR' => '10.0.0.42'])->withHeader('Host', 'shop.test');
tests/Feature/Admin/SettingsManagementTest.php:151:        ->set('termsUrl', 'https://shop.test/pages/terms')
tests/Feature/Admin/SettingsManagementTest.php:166:        ->and(data_get($settings, 'checkout.terms_url'))->toBe('https://shop.test/pages/terms')
tests/Feature/Admin/SettingsManagementTest.php:179:        ->set('senderEmail', 'ops@shop.test')
tests/Feature/Admin/SettingsManagementTest.php:180:        ->set('replyToEmail', 'support@shop.test')
tests/Feature/Admin/SettingsManagementTest.php:193:        ->and(data_get($settings, 'notifications.sender_email'))->toBe('ops@shop.test')
tests/Feature/Admin/SettingsManagementTest.php:194:        ->and(data_get($settings, 'notifications.reply_to_email'))->toBe('support@shop.test')
tests/Feature/Api/StorefrontAnalyticsApiTest.php:37:    $this->withHeader('Host', 'shop.test')
tests/Feature/Api/StorefrontAnalyticsApiTest.php:43:    $this->withHeader('Host', 'shop.test')
tests/Feature/Api/StorefrontAnalyticsApiTest.php:55:    $this->withHeader('Host', 'shop.test')
tests/Feature/Api/StorefrontAnalyticsApiTest.php:62:    $this->withHeader('Host', 'shop.test')
tests/Feature/Catalog/CatalogUiTest.php:23:    $this->withHeader('Host', 'shop.test')
tests/Feature/Catalog/CatalogUiTest.php:30:    $this->withHeader('Host', 'shop.test')
tests/Feature/Catalog/CatalogUiTest.php:37:    $this->withHeader('Host', 'shop.test')
tests/Feature/Catalog/CatalogUiTest.php:45:    $this->withHeader('Host', 'shop.test')
tests/Feature/Api/AdminStoreSettingsApiTest.php:73:        ->assertJsonPath('data.settings_json.notifications.sender_email', 'no-reply@shop.test');
tests/Feature/Api/AdminStoreSettingsApiTest.php:81:        ->and($settings->settings_json['notifications']['sender_email'])->toBe('no-reply@shop.test');


status: completed

input:
*** Begin Patch
*** Update File: routes/web.php
@@
 use App\Livewire\Storefront\Account\Auth\ForgotPassword as CustomerForgotPassword;
 use App\Livewire\Storefront\Account\Auth\Login as CustomerLogin;
 use App\Livewire\Storefront\Account\Auth\Register as CustomerRegister;
 use App\Livewire\Storefront\Account\Auth\ResetPassword as CustomerResetPassword;
+use App\Livewire\Storefront\Account\Addresses\Index as CustomerAddressesIndex;
 use App\Livewire\Storefront\Account\Orders\Index as CustomerOrdersIndex;
 use App\Livewire\Storefront\Account\Orders\Show as CustomerOrderShow;
@@
     Route::livewire('account', CustomerOrdersIndex::class)
         ->middleware('auth:customer')
         ->name('account.dashboard');

+    Route::livewire('account/orders', CustomerOrdersIndex::class)
+        ->middleware('auth:customer')
+        ->name('account.orders.index');
+
     Route::livewire('account/orders/{order}', CustomerOrderShow::class)
         ->middleware('auth:customer')
         ->name('account.orders.show');
+
+    Route::livewire('account/addresses', CustomerAddressesIndex::class)
+        ->middleware('auth:customer')
+        ->name('account.addresses.index');
+
+    Route::post('account/logout', function () {
+        Auth::guard('customer')->logout();
+
+        request()->session()->invalidate();
+        request()->session()->regenerateToken();
+
+        return redirect()->route('account.login');
+    })->middleware('auth:customer')->name('account.logout');
 });
*** End Patch


stdout:
Success. Updated the following files:
M routes/web.php

type: update

unified_diff:
@@ -37,2 +37,3 @@
 use App\Livewire\Storefront\Account\Auth\ResetPassword as CustomerResetPassword;
+use App\Livewire\Storefront\Account\Addresses\Index as CustomerAddressesIndex;
 use App\Livewire\Storefront\Account\Orders\Index as CustomerOrdersIndex;
@@ -172,2 +173,6 @@

+    Route::livewire('account/orders', CustomerOrdersIndex::class)
+        ->middleware('auth:customer')
+        ->name('account.orders.index');
+
     Route::livewire('account/orders/{order}', CustomerOrderShow::class)
@@ -175,2 +180,15 @@
         ->name('account.orders.show');
+
+    Route::livewire('account/addresses', CustomerAddressesIndex::class)
+        ->middleware('auth:customer')
+        ->name('account.addresses.index');
+
+    Route::post('account/logout', function () {
+        Auth::guard('customer')->logout();
+
+        request()->session()->invalidate();
+        request()->session()->regenerateToken();
+
+        return redirect()->route('account.login');
+    })->middleware('auth:customer')->name('account.logout');
 });


output: {"output":"Success. Updated the following files:\nM routes/web.php\n","metadata":{"exit_code":0,"duration_seconds":0.0}}


status: completed

input:
*** Begin Patch
*** Update File: app/Livewire/Storefront/Account/Orders/Index.php
@@
     public function render(): mixed
     {
+        $isDashboard = request()->routeIs('account.dashboard');
+
         return view('livewire.storefront.account.orders.index', [
-            'orders' => $this->orders(),
+            'customer' => $this->customer(),
+            'isDashboard' => $isDashboard,
+            'orders' => $this->orders($isDashboard),
         ])->layout('layouts.storefront', [
             'title' => 'Account',
         ]);
     }

@@
-    private function orders(): Collection
+    private function orders(bool $isDashboard): Collection
     {
-        $customer = Auth::guard('customer')->user();
-
-        abort_unless($customer instanceof Customer, 403);
-
         return Order::withoutGlobalScopes()
             ->where('store_id', $this->storeId)
-            ->where('customer_id', $customer->getKey())
+            ->where('customer_id', $this->customer()->getKey())
             ->latest('placed_at')
-            ->limit(20)
+            ->latest('id')
+            ->limit($isDashboard ? 5 : 20)
             ->get();
     }
+
+    private function customer(): Customer
+    {
+        $customer = Auth::guard('customer')->user();
+
+        abort_unless($customer instanceof Customer, 403);
+
+        return Customer::withoutGlobalScopes()
+            ->where('store_id', $this->storeId)
+            ->whereKey($customer->getKey())
+            ->firstOrFail();
+    }
 }
*** End Patch


stdout:
Success. Updated the following files:
M app/Livewire/Storefront/Account/Orders/Index.php

unified_diff:
@@ -28,4 +28,8 @@
     {
+        $isDashboard = request()->routeIs('account.dashboard');
+
         return view('livewire.storefront.account.orders.index', [
-            'orders' => $this->orders(),
+            'customer' => $this->customer(),
+            'isDashboard' => $isDashboard,
+            'orders' => $this->orders($isDashboard),
         ])->layout('layouts.storefront', [
@@ -38,4 +42,15 @@
      */
-    private function orders(): Collection
+    private function orders(bool $isDashboard): Collection
     {
+        return Order::withoutGlobalScopes()
+            ->where('store_id', $this->storeId)
+            ->where('customer_id', $this->customer()->getKey())
+            ->latest('placed_at')
+            ->latest('id')
+            ->limit($isDashboard ? 5 : 20)
+            ->get();
+    }
+
+    private function customer(): Customer
+    {
         $customer = Auth::guard('customer')->user();
@@ -44,8 +59,6 @@

-        return Order::withoutGlobalScopes()
+        return Customer::withoutGlobalScopes()
             ->where('store_id', $this->storeId)
-            ->where('customer_id', $customer->getKey())
-            ->latest('placed_at')
-            ->limit(20)
-            ->get();
+            ->whereKey($customer->getKey())
+            ->firstOrFail();
     }


output: {"output":"Success. Updated the following files:\nM app/Livewire/Storefront/Account/Orders/Index.php\n","metadata":{"exit_code":0,"duration_seconds":0.0}}


status: completed

input:
*** Begin Patch
*** Update File: app/Livewire/Storefront/Account/Orders/Show.php
@@
     public function render(): mixed
     {
         return view('livewire.storefront.account.orders.show', [
+            'customer' => $this->customer(),
             'order' => $this->order(),
         ])->layout('layouts.storefront', [
             'title' => 'Order details',
         ]);
     }
@@
             ->where('customer_id', Auth::guard('customer')->id())
             ->findOrFail($this->orderId);
     }
+
+    private function customer(): Customer
+    {
+        $customer = Auth::guard('customer')->user();
+
+        abort_unless($customer instanceof Customer, 403);
+
+        return Customer::withoutGlobalScopes()
+            ->where('store_id', $this->storeId)
+            ->whereKey($customer->getKey())
+            ->firstOrFail();
+    }
 }
*** End Patch


stdout:
Success. Updated the following files:
M app/Livewire/Storefront/Account/Orders/Show.php

unified_diff:
@@ -41,2 +41,3 @@
         return view('livewire.storefront.account.orders.show', [
+            'customer' => $this->customer(),
             'order' => $this->order(),
@@ -55,2 +56,14 @@
     }
+
+    private function customer(): Customer
+    {
+        $customer = Auth::guard('customer')->user();
+
+        abort_unless($customer instanceof Customer, 403);
+
+        return Customer::withoutGlobalScopes()
+            ->where('store_id', $this->storeId)
+            ->whereKey($customer->getKey())
+            ->firstOrFail();
+    }
 }


output: {"output":"Success. Updated the following files:\nM app/Livewire/Storefront/Account/Orders/Show.php\n","metadata":{"exit_code":0,"duration_seconds":0.0}}


status: completed

input:
*** Begin Patch
*** Update File: app/Livewire/Storefront/Account/Addresses/Index.php
@@
 namespace App\Livewire\Storefront\Account\Addresses;

+use App\Models\Customer;
+use App\Models\CustomerAddress;
+use App\Models\Store;
+use Illuminate\Support\Collection;
+use Illuminate\Support\Facades\Auth;
+use Illuminate\Support\Facades\DB;
+use Livewire\Attributes\Locked;
 use Livewire\Component;

 class Index extends Component
 {
-    public function render()
+    #[Locked]
+    public int $storeId;
+
+    #[Locked]
+    public int $customerId;
+
+    public bool $showForm = false;
+
+    public ?int $editingAddressId = null;
+
+    public ?string $statusMessage = null;
+
+    public string $addressLabel = '';
+
+    /**
+     * @var array{first_name: string, last_name: string, address1: string, address2: string, city: string, province_code: string, country: string, postal_code: string}
+     */
+    public array $address = [
+        'first_name' => '',
+        'last_name' => '',
+        'address1' => '',
+        'address2' => '',
+        'city' => '',
+        'province_code' => '',
+        'country' => 'DE',
+        'postal_code' => '',
+    ];
+
+    public function mount(): void
+    {
+        $store = app('current_store');
+        $customer = Auth::guard('customer')->user();
+
+        abort_unless($store instanceof Store && $customer instanceof Customer, 404);
+
+        $this->storeId = $store->getKey();
+        $this->customerId = $customer->getKey();
+    }
+
+    public function openAddressForm(?int $addressId = null): void
+    {
+        $this->resetValidation();
+        $this->statusMessage = null;
+        $this->editingAddressId = $addressId;
+
+        if ($addressId !== null) {
+            $address = $this->addressRecord($addressId);
+
+            $this->addressLabel = (string) $address->label;
+            $this->address = array_merge($this->emptyAddress(), $address->address_json ?? []);
+        } else {
+            $this->resetAddressForm();
+        }
+
+        $this->showForm = true;
+    }
+
+    public function saveAddress(): void
+    {
+        $this->validate([
+            'addressLabel' => ['nullable', 'string', 'max:255'],
+            'address.first_name' => ['required', 'string', 'max:255'],
+            'address.last_name' => ['required', 'string', 'max:255'],
+            'address.address1' => ['required', 'string', 'max:255'],
+            'address.address2' => ['nullable', 'string', 'max:255'],
+            'address.city' => ['required', 'string', 'max:255'],
+            'address.province_code' => ['nullable', 'string', 'max:255'],
+            'address.country' => ['required', 'string', 'size:2'],
+            'address.postal_code' => ['required', 'string', 'max:32'],
+        ]);
+
+        $address = $this->editingAddressId !== null
+            ? $this->addressRecord($this->editingAddressId)
+            : new CustomerAddress(['customer_id' => $this->customerId]);
+
+        $address->fill([
+            'label' => $this->addressLabel !== '' ? $this->addressLabel : null,
+            'address_json' => $this->address,
+            'is_default' => $address->exists ? $address->is_default : ! $this->customer()->addresses()->exists(),
+        ]);
+        $address->save();
+
+        $this->resetAddressForm();
+        $this->showForm = false;
+        $this->statusMessage = __('Address saved');
+    }
+
+    public function deleteAddress(int $addressId): void
+    {
+        $address = $this->addressRecord($addressId);
+        $wasDefault = $address->is_default;
+
+        $address->delete();
+
+        if ($wasDefault) {
+            $this->setFirstAddressAsDefault();
+        }
+
+        $this->statusMessage = __('Address deleted');
+    }
+
+    public function setDefaultAddress(int $addressId): void
+    {
+        $address = $this->addressRecord($addressId);
+
+        DB::transaction(function () use ($address): void {
+            CustomerAddress::query()
+                ->where('customer_id', $this->customerId)
+                ->update(['is_default' => false]);
+
+            $address->forceFill(['is_default' => true])->save();
+        });
+
+        $this->statusMessage = __('Default address updated');
+    }
+
+    public function cancelAddressForm(): void
+    {
+        $this->resetValidation();
+        $this->resetAddressForm();
+        $this->showForm = false;
+    }
+
+    public function render(): mixed
     {
-        return view('livewire.storefront.account.addresses.index');
+        return view('livewire.storefront.account.addresses.index', [
+            'addresses' => $this->addresses(),
+            'customer' => $this->customer(),
+        ])->layout('layouts.storefront', [
+            'title' => 'Addresses',
+        ]);
+    }
+
+    /**
+     * @return Collection<int, CustomerAddress>
+     */
+    private function addresses(): Collection
+    {
+        return CustomerAddress::query()
+            ->where('customer_id', $this->customerId)
+            ->orderByDesc('is_default')
+            ->orderBy('id')
+            ->get();
+    }
+
+    private function customer(): Customer
+    {
+        return Customer::withoutGlobalScopes()
+            ->where('store_id', $this->storeId)
+            ->whereKey($this->customerId)
+            ->firstOrFail();
+    }
+
+    private function addressRecord(int $addressId): CustomerAddress
+    {
+        return CustomerAddress::query()
+            ->where('customer_id', $this->customerId)
+            ->whereKey($addressId)
+            ->firstOrFail();
+    }
+
+    private function setFirstAddressAsDefault(): void
+    {
+        $nextAddress = CustomerAddress::query()
+            ->where('customer_id', $this->customerId)
+            ->oldest('id')
+            ->first();
+
+        if ($nextAddress instanceof CustomerAddress) {
+            $nextAddress->forceFill(['is_default' => true])->save();
+        }
+    }
+
+    private function resetAddressForm(): void
+    {
+        $this->editingAddressId = null;
+        $this->addressLabel = '';
+        $this->address = $this->emptyAddress();
+    }
+
+    /**
+     * @return array{first_name: string, last_name: string, address1: string, address2: string, city: string, province_code: string, country: string, postal_code: string}
+     */
+    private function emptyAddress(): array
+    {
+        return [
+            'first_name' => '',
+            'last_name' => '',
+            'address1' => '',
+            'address2' => '',
+            'city' => '',
+            'province_code' => '',
+            'country' => 'DE',
+            'postal_code' => '',
+        ];
     }
 }
*** End Patch


stdout:
Success. Updated the following files:
M app/Livewire/Storefront/Account/Addresses/Index.php

unified_diff:
@@ -4,2 +4,9 @@

+use App\Models\Customer;
+use App\Models\CustomerAddress;
+use App\Models\Store;
+use Illuminate\Support\Collection;
+use Illuminate\Support\Facades\Auth;
+use Illuminate\Support\Facades\DB;
+use Livewire\Attributes\Locked;
 use Livewire\Component;
@@ -8,5 +15,197 @@
 {
-    public function render()
+    #[Locked]
+    public int $storeId;
+
+    #[Locked]
+    public int $customerId;
+
+    public bool $showForm = false;
+
+    public ?int $editingAddressId = null;
+
+    public ?string $statusMessage = null;
+
+    public string $addressLabel = '';
+
+    /**
+     * @var array{first_name: string, last_name: string, address1: string, address2: string, city: string, province_code: string, country: string, postal_code: string}
+     */
+    public array $address = [
+        'first_name' => '',
+        'last_name' => '',
+        'address1' => '',
+        'address2' => '',
+        'city' => '',
+        'province_code' => '',
+        'country' => 'DE',
+        'postal_code' => '',
+    ];
+
+    public function mount(): void
+    {
+        $store = app('current_store');
+        $customer = Auth::guard('customer')->user();
+
+        abort_unless($store instanceof Store && $customer instanceof Customer, 404);
+
+        $this->storeId = $store->getKey();
+        $this->customerId = $customer->getKey();
+    }
+
+    public function openAddressForm(?int $addressId = null): void
+    {
+        $this->resetValidation();
+        $this->statusMessage = null;
+        $this->editingAddressId = $addressId;
+
+        if ($addressId !== null) {
+            $address = $this->addressRecord($addressId);
+
+            $this->addressLabel = (string) $address->label;
+            $this->address = array_merge($this->emptyAddress(), $address->address_json ?? []);
+        } else {
+            $this->resetAddressForm();
+        }
+
+        $this->showForm = true;
+    }
+
+    public function saveAddress(): void
     {
-        return view('livewire.storefront.account.addresses.index');
+        $this->validate([
+            'addressLabel' => ['nullable', 'string', 'max:255'],
+            'address.first_name' => ['required', 'string', 'max:255'],
+            'address.last_name' => ['required', 'string', 'max:255'],
+            'address.address1' => ['required', 'string', 'max:255'],
+            'address.address2' => ['nullable', 'string', 'max:255'],
+            'address.city' => ['required', 'string', 'max:255'],
+            'address.province_code' => ['nullable', 'string', 'max:255'],
+            'address.country' => ['required', 'string', 'size:2'],
+            'address.postal_code' => ['required', 'string', 'max:32'],
+        ]);
+
+        $address = $this->editingAddressId !== null
+            ? $this->addressRecord($this->editingAddressId)
+            : new CustomerAddress(['customer_id' => $this->customerId]);
+
+        $address->fill([
+            'label' => $this->addressLabel !== '' ? $this->addressLabel : null,
+            'address_json' => $this->address,
+            'is_default' => $address->exists ? $address->is_default : ! $this->customer()->addresses()->exists(),
+        ]);
+        $address->save();
+
+        $this->resetAddressForm();
+        $this->showForm = false;
+        $this->statusMessage = __('Address saved');
+    }
+
+    public function deleteAddress(int $addressId): void
+    {
+        $address = $this->addressRecord($addressId);
+        $wasDefault = $address->is_default;
+
+        $address->delete();
+
+        if ($wasDefault) {
+            $this->setFirstAddressAsDefault();
+        }
+
+        $this->statusMessage = __('Address deleted');
+    }
+
+    public function setDefaultAddress(int $addressId): void
+    {
+        $address = $this->addressRecord($addressId);
+
+        DB::transaction(function () use ($address): void {
+            CustomerAddress::query()
+                ->where('customer_id', $this->customerId)
+                ->update(['is_default' => false]);
+
+            $address->forceFill(['is_default' => true])->save();
+        });
+
+        $this->statusMessage = __('Default address updated');
+    }
+
+    public function cancelAddressForm(): void
+    {
+        $this->resetValidation();
+        $this->resetAddressForm();
+        $this->showForm = false;
+    }
+
+    public function render(): mixed
+    {
+        return view('livewire.storefront.account.addresses.index', [
+            'addresses' => $this->addresses(),
+            'customer' => $this->customer(),
+        ])->layout('layouts.storefront', [
+            'title' => 'Addresses',
+        ]);
+    }
+
+    /**
+     * @return Collection<int, CustomerAddress>
+     */
+    private function addresses(): Collection
+    {
+        return CustomerAddress::query()
+            ->where('customer_id', $this->customerId)
+            ->orderByDesc('is_default')
+            ->orderBy('id')
+            ->get();
+    }
+
+    private function customer(): Customer
+    {
+        return Customer::withoutGlobalScopes()
+            ->where('store_id', $this->storeId)
+            ->whereKey($this->customerId)
+            ->firstOrFail();
+    }
+
+    private function addressRecord(int $addressId): CustomerAddress
+    {
+        return CustomerAddress::query()
+            ->where('customer_id', $this->customerId)
+            ->whereKey($addressId)
+            ->firstOrFail();
+    }
+
+    private function setFirstAddressAsDefault(): void
+    {
+        $nextAddress = CustomerAddress::query()
+            ->where('customer_id', $this->customerId)
+            ->oldest('id')
+            ->first();
+
+        if ($nextAddress instanceof CustomerAddress) {
+            $nextAddress->forceFill(['is_default' => true])->save();
+        }
+    }
+
+    private function resetAddressForm(): void
+    {
+        $this->editingAddressId = null;
+        $this->addressLabel = '';
+        $this->address = $this->emptyAddress();
+    }
+
+    /**
+     * @return array{first_name: string, last_name: string, address1: string, address2: string, city: string, province_code: string, country: string, postal_code: string}
+     */
+    private function emptyAddress(): array
+    {
+        return [
+            'first_name' => '',
+            'last_name' => '',
+            'address1' => '',
+            'address2' => '',
+            'city' => '',
+            'province_code' => '',
+            'country' => 'DE',
+            'postal_code' => '',
+        ];
     }


output: {"output":"Success. Updated the following files:\nM app/Livewire/Storefront/Account/Addresses/Index.php\n","metadata":{"exit_code":0,"duration_seconds":0.0}}


status: completed

input:
*** Begin Patch
*** Add File: resources/views/components/storefront/account-shell.blade.php
+@props(['customer'])
+
+

+

+
+

+
My Account

+
{{ $customer->name ?: $customer->email }}

+

+
+
+                 request()->routeIs('account.dashboard'),
+                        'text-zinc-600 hover:bg-zinc-50 hover:text-zinc-950 dark:text-zinc-300 dark:hover:bg-zinc-900 dark:hover:text-white' => ! request()->routeIs('account.dashboard'),
+                    ])
+                    wire:navigate
+                >
+                    Overview
+
+                 request()->routeIs('account.orders.*'),
+                        'text-zinc-600 hover:bg-zinc-50 hover:text-zinc-950 dark:text-zinc-300 dark:hover:bg-zinc-900 dark:hover:text-white' => ! request()->routeIs('account.orders.*'),
+                    ])
+                    wire:navigate
+                >
+                    Orders
+
+                 request()->routeIs('account.addresses.*'),
+                        'text-zinc-600 hover:bg-zinc-50 hover:text-zinc-950 dark:text-zinc-300 dark:hover:bg-zinc-900 dark:hover:text-white' => ! request()->routeIs('account.addresses.*'),
+                    ])
+                    wire:navigate
+                >
+                    Addresses
+
+
+
+            <form method="POST" action="{{ route('account.logout') }}" class="mt-6">
+                @csrf
+                <flux:button type="submit" variant="filled" icon="arrow-right-start-on-rectangle" class="w-full justify-center" data-test="customer-logout-button">
+                    Logout
+                </flux:button>
+            </form>
+
+
+

+            {{ $slot }}
+

+

+

*** End Patch


stdout:
Success. Updated the following files:
A resources/views/components/storefront/account-shell.blade.php

type: add

content:
@props(['customer'])

My Account

{{ $customer->name ?: $customer->email }}

                 request()->routeIs('account.dashboard'),
                        'text-zinc-600 hover:bg-zinc-50 hover:text-zinc-950 dark:text-zinc-300 dark:hover:bg-zinc-900 dark:hover:text-white' => ! request()->routeIs('account.dashboard'),
                    ])
                    wire:navigate
                >
                    Overview

                 request()->routeIs('account.orders.*'),
                        'text-zinc-600 hover:bg-zinc-50 hover:text-zinc-950 dark:text-zinc-300 dark:hover:bg-zinc-900 dark:hover:text-white' => ! request()->routeIs('account.orders.*'),
                    ])
                    wire:navigate
                >
                    Orders

                 request()->routeIs('account.addresses.*'),
                        'text-zinc-600 hover:bg-zinc-50 hover:text-zinc-950 dark:text-zinc-300 dark:hover:bg-zinc-900 dark:hover:text-white' => ! request()->routeIs('account.addresses.*'),
                    ])
                    wire:navigate
                >
                    Addresses

            <form method="POST" action="{{ route('account.logout') }}" class="mt-6">
                @csrf
                <flux:button type="submit" variant="filled" icon="arrow-right-start-on-rectangle" class="w-full justify-center" data-test="customer-logout-button">
                    Logout
                </flux:button>
            </form>

            {{ $slot }}


output: {"output":"Success. Updated the following files:\nA resources/views/components/storefront/account-shell.blade.php\n","metadata":{"exit_code":0,"duration_seconds":0.0}}


status: completed

input:
*** Begin Patch
*** Delete File: resources/views/livewire/storefront/account/orders/index.blade.php
*** End Patch


stdout:
Success. Updated the following files:
D resources/views/livewire/storefront/account/orders/index.blade.php

type: delete

content:
    <x-storefront.breadcrumbs :items="[
        ['label' => 'Account'],
    ]" />

Orders

            @forelse ($orders as $order)

{{ $order->order_number }}

{{ $order->placed_at?->format('M j, Y') }}

                        <flux:badge>{{ $order->financial_status->value }}</flux:badge>
                        <flux:badge>{{ $order->fulfillment_status->value }}</flux:badge>

                    <x-storefront.price :amount="$order->total_amount" :currency="$order->currency" class="justify-start sm:justify-end" />

            @empty

                    <flux:icon name="shopping-bag" class="mx-auto size-10 text-zinc-400 dark:text-zinc-600" />

No orders yet

                    <flux:button :href="route('collections.index')" wire:navigate variant="primary" class="mt-6">
                        Browse products
                    </flux:button>

            @endforelse


output: {"output":"Success. Updated the following files:\nD resources/views/livewire/storefront/account/orders/index.blade.php\n","metadata":{"exit_code":0,"duration_seconds":0.0}}


status: completed

input:
*** Begin Patch
*** Add File: resources/views/livewire/storefront/account/orders/index.blade.php
+<x-storefront.account-shell :customer="$customer">
+    <x-storefront.breadcrumbs :items="[
+        ['label' => 'Account', 'url' => route('account.dashboard')],
+        ['label' => $isDashboard ? 'Overview' : 'Orders'],
+    ]" />
+
+

+        @if ($isDashboard)
+

+
Welcome back, {{ Str::before($customer->name ?: $customer->email, ' ') }}!

+
Review orders and manage saved checkout details.

+

+
+

+
+                    <flux:icon name="shopping-bag" class="size-6 text-zinc-500 dark:text-zinc-400" />
+
Order history

+
View all your orders.

+
+
+
+                    <flux:icon name="map-pin" class="size-6 text-zinc-500 dark:text-zinc-400" />
+
Addresses

+
Manage your addresses.

+
+
+                <form method="POST" action="{{ route('account.logout') }}" class="rounded-lg border border-zinc-200 bg-white p-5 hover:bg-zinc-50 dark:border-zinc-800 dark:bg-zinc-950 dark:hover:bg-zinc-900">
+                    @csrf
+                    <button type="submit" class="block w-full text-left" data-test="customer-dashboard-logout-button">
+                        <flux:icon name="arrow-right-start-on-rectangle" class="size-6 text-zinc-500 dark:text-zinc-400" />
+                        Log out
+                        End this customer session.
+                    </button>
+                </form>
+

+        @else
+

+
Order History

+
All orders placed from this account.

+

+        @endif
+
+

+

+
{{ $isDashboard ? 'Recent Orders' : 'Orders' }}

+

+
+            @forelse ($orders as $order)
+
+

+
{{ $order->order_number }}

+
{{ $order->placed_at?->format('M j, Y') }}

+

+

+                        <flux:badge>{{ Str::headline($order->financial_status->value) }}</flux:badge>
+                        <flux:badge>{{ Str::headline($order->fulfillment_status->value) }}</flux:badge>
+

+                    <x-storefront.price :amount="$order->total_amount" :currency="$order->currency" class="justify-start sm:justify-end" />
+
+            @empty
+

+                    <flux:icon name="shopping-bag" class="mx-auto size-10 text-zinc-400 dark:text-zinc-600" />
+
No orders yet

+                    <flux:button :href="route('collections.index')" wire:navigate variant="primary" class="mt-6">
+                        Browse products
+                    </flux:button>
+

+            @endforelse
+

+

+</x-storefront.account-shell>
*** End Patch


stdout:
Success. Updated the following files:
A resources/views/livewire/storefront/account/orders/index.blade.php

content:
<x-storefront.account-shell :customer="$customer">
    <x-storefront.breadcrumbs :items="[
        ['label' => 'Account', 'url' => route('account.dashboard')],
        ['label' => $isDashboard ? 'Overview' : 'Orders'],
    ]" />

        @if ($isDashboard)

Welcome back, {{ Str::before($customer->name ?: $customer->email, ' ') }}!

Review orders and manage saved checkout details.

                    <flux:icon name="shopping-bag" class="size-6 text-zinc-500 dark:text-zinc-400" />

Order history

View all your orders.

                    <flux:icon name="map-pin" class="size-6 text-zinc-500 dark:text-zinc-400" />

Addresses

Manage your addresses.

                <form method="POST" action="{{ route('account.logout') }}" class="rounded-lg border border-zinc-200 bg-white p-5 hover:bg-zinc-50 dark:border-zinc-800 dark:bg-zinc-950 dark:hover:bg-zinc-900">
                    @csrf
                    <button type="submit" class="block w-full text-left" data-test="customer-dashboard-logout-button">
                        <flux:icon name="arrow-right-start-on-rectangle" class="size-6 text-zinc-500 dark:text-zinc-400" />
                        Log out
                        End this customer session.
                    </button>
                </form>

        @else

Order History

All orders placed from this account.

        @endif

{{ $isDashboard ? 'Recent Orders' : 'Orders' }}

            @forelse ($orders as $order)

{{ $order->order_number }}

{{ $order->placed_at?->format('M j, Y') }}

                        <flux:badge>{{ Str::headline($order->financial_status->value) }}</flux:badge>
                        <flux:badge>{{ Str::headline($order->fulfillment_status->value) }}</flux:badge>

                    <x-storefront.price :amount="$order->total_amount" :currency="$order->currency" class="justify-start sm:justify-end" />

            @empty

                    <flux:icon name="shopping-bag" class="mx-auto size-10 text-zinc-400 dark:text-zinc-600" />

No orders yet

                    <flux:button :href="route('collections.index')" wire:navigate variant="primary" class="mt-6">
                        Browse products
                    </flux:button>

            @endforelse

</x-storefront.account-shell>


output: {"output":"Success. Updated the following files:\nA resources/views/livewire/storefront/account/orders/index.blade.php\n","metadata":{"exit_code":0,"duration_seconds":0.0}}


status: completed

input:
*** Begin Patch
*** Delete File: resources/views/livewire/storefront/account/orders/show.blade.php
*** End Patch


stdout:
Success. Updated the following files:
D resources/views/livewire/storefront/account/orders/show.blade.php

content:
    <x-storefront.breadcrumbs :items="[
        ['label' => 'Account', 'url' => route('account.dashboard')],
        ['label' => $order->order_number],
    ]" />

{{ $order->order_number }}

{{ $order->placed_at?->format('M j, Y') }}

                <flux:heading size="lg">Items</flux:heading>

                    @foreach ($order->lines as $line)

getKey() }}">

{{ $line->title_snapshot }}

Qty {{ $line->quantity }}

                            <x-storefront.price :amount="$line->total_amount" :currency="$order->currency" />

                    @endforeach

            @if ($order->fulfillments->isNotEmpty())

                    <flux:heading size="lg">Fulfillment</flux:heading>

                        @foreach ($order->fulfillments as $fulfillment)

getKey() }}">

                                    {{ $fulfillment->status->value }}
                                    @if ($fulfillment->tracking_number)
                                        {{ $fulfillment->tracking_number }}
                                    @endif

                        @endforeach

            @endif

Summary

                <flux:badge>{{ $order->financial_status->value }}</flux:badge>
                <flux:badge>{{ $order->fulfillment_status->value }}</flux:badge>

                    Subtotal
                    <x-storefront.price :amount="$order->subtotal_amount" :currency="$order->currency" />

                    Discount
                    -{{ \App\Support\Money::format($order->discount_amount, $order->currency) }}

                    Shipping
                    <x-storefront.price :amount="$order->shipping_amount" :currency="$order->currency" />

                    Tax
                    <x-storefront.price :amount="$order->tax_amount" :currency="$order->currency" />

                    Total
                    <x-storefront.price :amount="$order->total_amount" :currency="$order->currency" />


output: {"output":"Success. Updated the following files:\nD resources/views/livewire/storefront/account/orders/show.blade.php\n","metadata":{"exit_code":0,"duration_seconds":0.0}}


status: completed

input:
*** Begin Patch
*** Add File: resources/views/livewire/storefront/account/orders/show.blade.php
+<x-storefront.account-shell :customer="$customer">
+    <x-storefront.breadcrumbs :items="[
+        ['label' => 'Account', 'url' => route('account.dashboard')],
+        ['label' => 'Orders', 'url' => route('account.orders.index')],
+        ['label' => $order->order_number],
+    ]" />
+
+

+

+

+
Order {{ $order->order_number }}

+
Placed on {{ $order->placed_at?->format('F j, Y') }}

+

+
+

+                <flux:heading size="lg">Items</flux:heading>
+

+                    @foreach ($order->lines as $line)
+
getKey() }}">
+

+
{{ $line->title_snapshot }}

+
Qty {{ $line->quantity }}

+

+                            <x-storefront.price :amount="$line->total_amount" :currency="$order->currency" />
+

+                    @endforeach
+

+

+
+

+

+                    <flux:heading size="lg">Shipping Address</flux:heading>
+                    @php($shippingAddress = $order->shipping_address_json ?? [])
+

+
{{ trim(data_get($shippingAddress, 'first_name').' '.data_get($shippingAddress, 'last_name')) }}

+
{{ data_get($shippingAddress, 'address1') }}

+                        @if (data_get($shippingAddress, 'address2'))
+
{{ data_get($shippingAddress, 'address2') }}

+                        @endif
+
{{ trim(data_get($shippingAddress, 'postal_code').' '.data_get($shippingAddress, 'city')) }}

+
{{ data_get($shippingAddress, 'country') }}

+

+

+
+

+                    <flux:heading size="lg">Payment</flux:heading>
+

+
{{ Str::headline($order->payment_method->value) }}

+

+                            <flux:badge>{{ Str::headline($order->financial_status->value) }}</flux:badge>
+                            <flux:badge>{{ Str::headline($order->fulfillment_status->value) }}</flux:badge>
+

+

+

+

+
+            @if ($order->fulfillments->isNotEmpty())
+

+                    <flux:heading size="lg">Fulfillment</flux:heading>
+

+                        @foreach ($order->fulfillments as $fulfillment)
+
getKey() }}">
+

+                                    {{ Str::headline($fulfillment->status->value) }}
+                                    @if ($fulfillment->tracking_number)
+                                        {{ $fulfillment->tracking_number }}
+                                    @endif
+

+

+                        @endforeach
+

+

+            @endif
+

+
+
+
Summary

+

+                <flux:badge>{{ Str::headline($order->financial_status->value) }}</flux:badge>
+                <flux:badge>{{ Str::headline($order->fulfillment_status->value) }}</flux:badge>
+

+

+

+                    Subtotal
+                    <x-storefront.price :amount="$order->subtotal_amount" :currency="$order->currency" />
+

+

+                    Discount
+                    -{{ \App\Support\Money::format($order->discount_amount, $order->currency) }}
+

+

+                    Shipping
+                    <x-storefront.price :amount="$order->shipping_amount" :currency="$order->currency" />
+

+

+                    Tax
+                    <x-storefront.price :amount="$order->tax_amount" :currency="$order->currency" />
+

+

+                    Total
+                    <x-storefront.price :amount="$order->total_amount" :currency="$order->currency" />
+

+

+
+

+</x-storefront.account-shell>
*** End Patch


stdout:
Success. Updated the following files:
A resources/views/livewire/storefront/account/orders/show.blade.php

content:
<x-storefront.account-shell :customer="$customer">
    <x-storefront.breadcrumbs :items="[
        ['label' => 'Account', 'url' => route('account.dashboard')],
        ['label' => 'Orders', 'url' => route('account.orders.index')],
        ['label' => $order->order_number],
    ]" />

Order {{ $order->order_number }}

Placed on {{ $order->placed_at?->format('F j, Y') }}

                <flux:heading size="lg">Items</flux:heading>

                    @foreach ($order->lines as $line)

getKey() }}">

{{ $line->title_snapshot }}

Qty {{ $line->quantity }}

                            <x-storefront.price :amount="$line->total_amount" :currency="$order->currency" />

                    @endforeach

                    <flux:heading size="lg">Shipping Address</flux:heading>
                    @php($shippingAddress = $order->shipping_address_json ?? [])

{{ trim(data_get($shippingAddress, 'first_name').' '.data_get($shippingAddress, 'last_name')) }}

{{ data_get($shippingAddress, 'address1') }}

                        @if (data_get($shippingAddress, 'address2'))

{{ data_get($shippingAddress, 'address2') }}

                        @endif

{{ trim(data_get($shippingAddress, 'postal_code').' '.data_get($shippingAddress, 'city')) }}

{{ data_get($shippingAddress, 'country') }}

                    <flux:heading size="lg">Payment</flux:heading>

{{ Str::headline($order->payment_method->value) }}

                            <flux:badge>{{ Str::headline($order->financial_status->value) }}</flux:badge>
                            <flux:badge>{{ Str::headline($order->fulfillment_status->value) }}</flux:badge>

            @if ($order->fulfillments->isNotEmpty())

                    <flux:heading size="lg">Fulfillment</flux:heading>

                        @foreach ($order->fulfillments as $fulfillment)

getKey() }}">

                                    {{ Str::headline($fulfillment->status->value) }}
                                    @if ($fulfillment->tracking_number)
                                        {{ $fulfillment->tracking_number }}
                                    @endif

                        @endforeach

            @endif

Summary

                <flux:badge>{{ Str::headline($order->financial_status->value) }}</flux:badge>
                <flux:badge>{{ Str::headline($order->fulfillment_status->value) }}</flux:badge>

                    Subtotal
                    <x-storefront.price :amount="$order->subtotal_amount" :currency="$order->currency" />

                    Discount
                    -{{ \App\Support\Money::format($order->discount_amount, $order->currency) }}

                    Shipping
                    <x-storefront.price :amount="$order->shipping_amount" :currency="$order->currency" />

                    Tax
                    <x-storefront.price :amount="$order->tax_amount" :currency="$order->currency" />

                    Total
                    <x-storefront.price :amount="$order->total_amount" :currency="$order->currency" />

</x-storefront.account-shell>


output: {"output":"Success. Updated the following files:\nA resources/views/livewire/storefront/account/orders/show.blade.php\n","metadata":{"exit_code":0,"duration_seconds":0.0}}


status: completed

input:
*** Begin Patch
*** Delete File: resources/views/livewire/storefront/account/addresses/index.blade.php
*** End Patch


stdout:
Success. Updated the following files:
D resources/views/livewire/storefront/account/addresses/index.blade.php

content: {{-- Nothing in life is to be feared, it is only to be understood. Now is the time to understand more, so that we may fear less. - Maria Skłodowska-Curie --}}


output: {"output":"Success. Updated the following files:\nD resources/views/livewire/storefront/account/addresses/index.blade.php\n","metadata":{"exit_code":0,"duration_seconds":0.0}}


status: completed

input:
*** Begin Patch
*** Add File: resources/views/livewire/storefront/account/addresses/index.blade.php
+<x-storefront.account-shell :customer="$customer">
+    <x-storefront.breadcrumbs :items="[
+        ['label' => 'Account', 'url' => route('account.dashboard')],
+        ['label' => 'Addresses'],
+    ]" />
+
+

+

+

+
Addresses

+
Saved shipping details for faster checkout.

+

+
+            <flux:button wire:click="openAddressForm" variant="primary" icon="plus">Add address</flux:button>
+

+
+        @if ($statusMessage)
+            <flux:callout color="green">
+                {{ $statusMessage }}
+            </flux:callout>
+        @endif
+
+        @if ($showForm)
+

+                <form wire:submit="saveAddress" class="space-y-6">
+

+                        <flux:heading size="lg">{{ $editingAddressId ? 'Edit address' : 'Add address' }}</flux:heading>
+

+
+                    <flux:input wire:model="addressLabel" label="Label" placeholder="Home, Office..." />
+
+

+                        <flux:input wire:model="address.first_name" label="First name" autocomplete="given-name" />
+                        <flux:input wire:model="address.last_name" label="Last name" autocomplete="family-name" />
+
+

+                            <flux:input wire:model="address.address1" label="Address line 1" autocomplete="address-line1" />
+                            <flux:error name="address.address1" />
+

+
+

+                            <flux:input wire:model="address.address2" label="Address line 2" autocomplete="address-line2" />
+

+
+                        <flux:input wire:model="address.city" label="City" autocomplete="address-level2" />
+                        <flux:input wire:model="address.province_code" label="State / Province" autocomplete="address-level1" />
+                        <flux:input wire:model="address.postal_code" label="Postal code" autocomplete="postal-code" />
+
+                        <flux:select wire:model="address.country" label="Country" autocomplete="country">
+                            <flux:select.option value="DE">Germany</flux:select.option>
+                            <flux:select.option value="AT">Austria</flux:select.option>
+                            <flux:select.option value="CH">Switzerland</flux:select.option>
+                            <flux:select.option value="US">United States</flux:select.option>
+                            <flux:select.option value="GB">United Kingdom</flux:select.option>
+                        </flux:select>
+

+
+

+                        <flux:error name="address.first_name" />
+                        <flux:error name="address.last_name" />
+                        <flux:error name="address.city" />
+                        <flux:error name="address.postal_code" />
+                        <flux:error name="address.country" />
+

+
+

+                        <flux:button type="button" wire:click="cancelAddressForm" variant="filled">Cancel</flux:button>
+                        <flux:button type="submit" variant="primary">Save</flux:button>
+

+                </form>
+

+        @endif
+
+

+            @forelse ($addresses as $addressRecord)
+                @php($addressData = $addressRecord->address_json ?? [])
+
+
getKey() }}" class="rounded-lg border border-zinc-200 bg-white p-5 dark:border-zinc-800 dark:bg-zinc-950">
+

+

+

+
{{ $addressRecord->label ?: 'Address' }}

+                                @if ($addressRecord->is_default)
+                                    <flux:badge color="green">Default</flux:badge>
+                                @endif
+

+

+
{{ trim(data_get($addressData, 'first_name').' '.data_get($addressData, 'last_name')) }}

+
{{ data_get($addressData, 'address1') }}

+                                @if (data_get($addressData, 'address2'))
+
{{ data_get($addressData, 'address2') }}

+                                @endif
+
{{ trim(data_get($addressData, 'postal_code').' '.data_get($addressData, 'city')) }}

+
{{ data_get($addressData, 'country') }}

+

+

+

+
+

+                        <flux:button wire:click="openAddressForm({{ $addressRecord->getKey() }})" size="sm" variant="filled">Edit</flux:button>
+                        @unless ($addressRecord->is_default)
+                            <flux:button wire:click="setDefaultAddress({{ $addressRecord->getKey() }})" size="sm" variant="ghost">Set default</flux:button>
+                        @endunless
+                        <flux:button wire:click="deleteAddress({{ $addressRecord->getKey() }})" wire:confirm="Delete this address?" size="sm" variant="danger">Delete</flux:button>
+

+

+            @empty
+

+                    <flux:icon name="map-pin" class="mx-auto size-8 text-zinc-400" />
+
No addresses saved.

+

+            @endforelse
+

+

+</x-storefront.account-shell>
*** End Patch


stdout:
Success. Updated the following files:
A resources/views/livewire/storefront/account/addresses/index.blade.php

content:
<x-storefront.account-shell :customer="$customer">
    <x-storefront.breadcrumbs :items="[
        ['label' => 'Account', 'url' => route('account.dashboard')],
        ['label' => 'Addresses'],
    ]" />

Addresses

Saved shipping details for faster checkout.

            <flux:button wire:click="openAddressForm" variant="primary" icon="plus">Add address</flux:button>

        @if ($statusMessage)
            <flux:callout color="green">
                {{ $statusMessage }}
            </flux:callout>
        @endif

        @if ($showForm)

                <form wire:submit="saveAddress" class="space-y-6">

                        <flux:heading size="lg">{{ $editingAddressId ? 'Edit address' : 'Add address' }}</flux:heading>

                    <flux:input wire:model="addressLabel" label="Label" placeholder="Home, Office..." />

                        <flux:input wire:model="address.first_name" label="First name" autocomplete="given-name" />
                        <flux:input wire:model="address.last_name" label="Last name" autocomplete="family-name" />

                            <flux:input wire:model="address.address1" label="Address line 1" autocomplete="address-line1" />
                            <flux:error name="address.address1" />

                            <flux:input wire:model="address.address2" label="Address line 2" autocomplete="address-line2" />

                        <flux:input wire:model="address.city" label="City" autocomplete="address-level2" />
                        <flux:input wire:model="address.province_code" label="State / Province" autocomplete="address-level1" />
                        <flux:input wire:model="address.postal_code" label="Postal code" autocomplete="postal-code" />

                        <flux:select wire:model="address.country" label="Country" autocomplete="country">
                            <flux:select.option value="DE">Germany</flux:select.option>
                            <flux:select.option value="AT">Austria</flux:select.option>
                            <flux:select.option value="CH">Switzerland</flux:select.option>
                            <flux:select.option value="US">United States</flux:select.option>
                            <flux:select.option value="GB">United Kingdom</flux:select.option>
                        </flux:select>

                        <flux:error name="address.first_name" />
                        <flux:error name="address.last_name" />
                        <flux:error name="address.city" />
                        <flux:error name="address.postal_code" />
                        <flux:error name="address.country" />

                        <flux:button type="button" wire:click="cancelAddressForm" variant="filled">Cancel</flux:button>
                        <flux:button type="submit" variant="primary">Save</flux:button>

                </form>

        @endif

            @forelse ($addresses as $addressRecord)
                @php($addressData = $addressRecord->address_json ?? [])

getKey() }}" class="rounded-lg border border-zinc-200 bg-white p-5 dark:border-zinc-800 dark:bg-zinc-950">

{{ $addressRecord->label ?: 'Address' }}

                                @if ($addressRecord->is_default)
                                    <flux:badge color="green">Default</flux:badge>
                                @endif

{{ trim(data_get($addressData, 'first_name').' '.data_get($addressData, 'last_name')) }}

{{ data_get($addressData, 'address1') }}

                                @if (data_get($addressData, 'address2'))

{{ data_get($addressData, 'address2') }}

                                @endif

{{ trim(data_get($addressData, 'postal_code').' '.data_get($addressData, 'city')) }}

{{ data_get($addressData, 'country') }}

                        <flux:button wire:click="openAddressForm({{ $addressRecord->getKey() }})" size="sm" variant="filled">Edit</flux:button>
                        @unless ($addressRecord->is_default)
                            <flux:button wire:click="setDefaultAddress({{ $addressRecord->getKey() }})" size="sm" variant="ghost">Set default</flux:button>
                        @endunless
                        <flux:button wire:click="deleteAddress({{ $addressRecord->getKey() }})" wire:confirm="Delete this address?" size="sm" variant="danger">Delete</flux:button>

            @empty

                    <flux:icon name="map-pin" class="mx-auto size-8 text-zinc-400" />

No addresses saved.

            @endforelse

</x-storefront.account-shell>


output: {"output":"Success. Updated the following files:\nA resources/views/livewire/storefront/account/addresses/index.blade.php\n","metadata":{"exit_code":0,"duration_seconds":0.0}}


cmd: rg "flux:callout" -n resources | sed -n '1,120p'