text:
### Open tabs
- 0: [Checkout](http://shop.test/checkout)
- 1: (current) [Create discount](http://shop.test/admin/discounts/create)
### Page
- Page URL: http://shop.test/admin/discounts/create
- Page Title: Create discount
### Snapshot
```yaml
- generic [ref=e251]:
  - generic [ref=e253]:
    - generic [ref=e254]: Type
    - radiogroup "Type" [ref=e255]:
      - generic [ref=e256]:
        - radio "Discount code" [checked] [ref=e257]
        - generic [ref=e260]: Discount code
        - generic [ref=e261]: Customers enter a code at checkout
      - generic [ref=e262]:
        - radio "Automatic discount" [ref=e263]
        - generic [ref=e265]: Automatic discount
        - generic [ref=e266]: Applied automatically at checkout
  - generic [ref=e267]:
    - generic [ref=e268]: Code
    - generic [ref=e269]:
      - generic [ref=e271]:
        - generic [ref=e272]: Discount code
        - textbox "Discount code" [ref=e274]:
          - /placeholder: SUMMER20
      - button "Generate" [ref=e276]:
        - img [ref=e278]
        - generic [ref=e281]: Generate
  - generic [ref=e282]:
    - generic [ref=e283]: Value
    - generic [ref=e284]:
      - generic [ref=e285]:
        - generic [ref=e286]: Value type
        - radiogroup "Value type" [ref=e287]:
          - generic [ref=e288]:
            - radio "Percentage" [checked] [ref=e289]
            - generic [ref=e292]: Percentage
          - generic [ref=e293]:
            - radio "Fixed amount" [ref=e294]
            - generic [ref=e296]: Fixed amount
          - generic [ref=e297]:
            - radio "Free shipping" [ref=e298]
            - generic [ref=e300]: Free shipping
      - generic [ref=e302]:
        - generic [ref=e303]: Percentage
        - spinbutton "Percentage" [ref=e305]: "10"
  - generic [ref=e306]:
    - generic [ref=e307]: Conditions
    - generic [ref=e308]:
      - generic [ref=e310]:
        - generic [ref=e311]: Minimum purchase amount
        - generic [ref=e312]: Leave empty for no minimum
        - spinbutton "Minimum purchase amount" [ref=e314]
      - generic [ref=e315]:
        - generic [ref=e317]:
          - generic [ref=e318]: Specific products
          - generic [ref=e319]:
            - generic:
              - img
            - textbox "Specific products" [ref=e320]:
              - /placeholder: Search products...
        - generic [ref=e323]:
          - generic [ref=e324]: Specific collections
          - generic [ref=e325]:
            - generic:
              - img
            - textbox "Specific collections" [ref=e326]:
              - /placeholder: Search collections...
  - generic [ref=e328]:
    - generic [ref=e329]: Usage limits
    - generic [ref=e330]:
      - generic [ref=e331]:
        - generic [ref=e332]: Total usage limit
        - spinbutton "Total usage limit" [ref=e334]
      - generic [ref=e336]:
        - checkbox "Limit to one use per customer" [ref=e337]
        - generic [ref=e339]: Limit to one use per customer
  - generic [ref=e340]:
    - generic [ref=e341]: Active dates
    - generic [ref=e342]:
      - generic [ref=e343]:
        - generic [ref=e344]: Start date
        - textbox "Start date" [ref=e346]: 2026-05-04T02:26
      - generic [ref=e347]:
        - generic [ref=e348]: End date
        - generic [ref=e349]: Leave empty for no end date
        - textbox "End date" [ref=e351]
  - generic [ref=e353]:
    - switch "Disabled" [ref=e354]
    - generic [ref=e356]: Disabled
  - generic [ref=e358]:
    - link "Discard" [ref=e359] [cursor=pointer]:
      - /url: http://shop.test/admin/discounts
    - button "Save" [ref=e360]:
      - img [ref=e362]
      - generic [ref=e365]: Save
```


output:
Wall time: 0.0246 seconds
Output:
[{"type":"text","text":"### Open tabs\n- 0: [Checkout](http://shop.test/checkout)\n- 1: (current) [Create discount](http://shop.test/admin/discounts/create)\n### Page\n- Page URL: http://shop.test/admin/discounts/create\n- Page Title: Create discount\n### Snapshot\n```yaml\n- generic [ref=e251]:\n  - generic [ref=e253]:\n    - generic [ref=e254]: Type\n    - radiogroup \"Type\" [ref=e255]:\n      - generic [ref=e256]:\n        - radio \"Discount code\" [checked] [ref=e257]\n        - generic [ref=e260]: Discount code\n        - generic [ref=e261]: Customers enter a code at checkout\n      - generic [ref=e262]:\n        - radio \"Automatic discount\" [ref=e263]\n        - generic [ref=e265]: Automatic discount\n        - generic [ref=e266]: Applied automatically at checkout\n  - generic [ref=e267]:\n    - generic [ref=e268]: Code\n    - generic [ref=e269]:\n      - generic [ref=e271]:\n        - generic [ref=e272]: Discount code\n        - textbox \"Discount code\" [ref=e274]:\n          - /placeholder: SUMMER20\n      - button \"Generate\" [ref=e276]:\n        - img [ref=e278]\n        - generic [ref=e281]: Generate\n  - generic [ref=e282]:\n    - generic [ref=e283]: Value\n    - generic [ref=e284]:\n      - generic [ref=e285]:\n        - generic [ref=e286]: Value type\n        - radiogroup \"Value type\" [ref=e287]:\n          - generic [ref=e288]:\n            - radio \"Percentage\" [checked] [ref=e289]\n            - generic [ref=e292]: Percentage\n          - generic [ref=e293]:\n            - radio \"Fixed amount\" [ref=e294]\n            - generic [ref=e296]: Fixed amount\n          - generic [ref=e297]:\n            - radio \"Free shipping\" [ref=e298]\n            - generic [ref=e300]: Free shipping\n      - generic [ref=e302]:\n        - generic [ref=e303]: Percentage\n        - spinbutton \"Percentage\" [ref=e305]: \"10\"\n  - generic [ref=e306]:\n    - generic [ref=e307]: Conditions\n    - generic [ref=e308]:\n      - generic [ref=e310]:\n        - generic [ref=e311]: Minimum purchase amount\n        - generic [ref=e312]: Leave empty for no minimum\n        - spinbutton \"Minimum purchase amount\" [ref=e314]\n      - generic [ref=e315]:\n        - generic [ref=e317]:\n          - generic [ref=e318]: Specific products\n          - generic [ref=e319]:\n            - generic:\n              - img\n            - textbox \"Specific products\" [ref=e320]:\n              - /placeholder: Search products...\n        - generic [ref=e323]:\n          - generic [ref=e324]: Specific collections\n          - generic [ref=e325]:\n            - generic:\n              - img\n            - textbox \"Specific collections\" [ref=e326]:\n              - /placeholder: Search collections...\n  - generic [ref=e328]:\n    - generic [ref=e329]: Usage limits\n    - generic [ref=e330]:\n      - generic [ref=e331]:\n        - generic [ref=e332]: Total usage limit\n        - spinbutton \"Total usage limit\" [ref=e334]\n      - generic [ref=e336]:\n        - checkbox \"Limit to one use per customer\" [ref=e337]\n        - generic [ref=e339]: Limit to one use per customer\n  - generic [ref=e340]:\n    - generic [ref=e341]: Active dates\n    - generic [ref=e342]:\n      - generic [ref=e343]:\n        - generic [ref=e344]: Start date\n        - textbox \"Start date\" [ref=e346]: 2026-05-04T02:26\n      - generic [ref=e347]:\n        - generic [ref=e348]: End date\n        - generic [ref=e349]: Leave empty for no end date\n        - textbox \"End date\" [ref=e351]\n  - generic [ref=e353]:\n    - switch \"Disabled\" [ref=e354]\n    - generic [ref=e356]: Disabled\n  - generic [ref=e358]:\n    - link \"Discard\" [ref=e359] [cursor=pointer]:\n      - /url: http://shop.test/admin/discounts\n    - button \"Save\" [ref=e360]:\n      - img [ref=e362]\n      - generic [ref=e365]: Save\n```"}]


Discount code

type: textbox

Limit to one use per customer

type: checkbox

value: true


server: playwright

type: text

text:
### Ran Playwright code
```js
await page.getByRole('textbox', { name: 'Discount code' }).fill('e2esmoke');
await page.getByRole('spinbutton', { name: 'Percentage' }).fill('15');
await page.getByRole('spinbutton', { name: 'Minimum purchase amount' }).fill('25');
await page.getByRole('spinbutton', { name: 'Total usage limit' }).fill('3');
await page.getByRole('checkbox', { name: 'Limit to one use per customer' }).setChecked(true);
```


output:
Wall time: 0.1492 seconds
Output:
[{"type":"text","text":"### Ran Playwright code\n```js\nawait page.getByRole('textbox', { name: 'Discount code' }).fill('e2esmoke');\nawait page.getByRole('spinbutton', { name: 'Percentage' }).fill('15');\nawait page.getByRole('spinbutton', { name: 'Minimum purchase amount' }).fill('25');\nawait page.getByRole('spinbutton', { name: 'Total usage limit' }).fill('3');\nawait page.getByRole('checkbox', { name: 'Limit to one use per customer' }).setChecked(true);\n```"}]


element: Status switch

text:
### Ran Playwright code
```js
await page.getByRole('switch', { name: 'Disabled' }).click();
```
### Open tabs
- 0: [Checkout](http://shop.test/checkout)
- 1: (current) [Create discount](http://shop.test/admin/discounts/create)
### Page
- Page URL: http://shop.test/admin/discounts/create
- Page Title: Create discount
### Snapshot
- [Snapshot](.playwright-mcp/page-2026-05-04T02-27-13-186Z.yml)


output:
Wall time: 1.0731 seconds
Output:
[{"type":"text","text":"### Ran Playwright code\n```js\nawait page.getByRole('switch', { name: 'Disabled' }).click();\n```\n### Open tabs\n- 0: [Checkout](http://shop.test/checkout)\n- 1: (current) [Create discount](http://shop.test/admin/discounts/create)\n### Page\n- Page URL: http://shop.test/admin/discounts/create\n- Page Title: Create discount\n### Snapshot\n- [Snapshot](.playwright-mcp/page-2026-05-04T02-27-13-186Z.yml)"}]


text:
### Open tabs
- 0: [Checkout](http://shop.test/checkout)
- 1: (current) [Create discount](http://shop.test/admin/discounts/create)
### Page
- Page URL: http://shop.test/admin/discounts/create
- Page Title: Create discount
### Snapshot
```yaml
- generic [ref=e353]:
  - switch "Disabled" [checked] [active] [ref=e354]
  - generic [ref=e356]: Disabled
```


output:
Wall time: 0.0088 seconds
Output:
[{"type":"text","text":"### Open tabs\n- 0: [Checkout](http://shop.test/checkout)\n- 1: (current) [Create discount](http://shop.test/admin/discounts/create)\n### Page\n- Page URL: http://shop.test/admin/discounts/create\n- Page Title: Create discount\n### Snapshot\n```yaml\n- generic [ref=e353]:\n  - switch \"Disabled\" [checked] [active] [ref=e354]\n  - generic [ref=e356]: Disabled\n```"}]


text:
### Result
Waited for 1
### Ran Playwright code
```js
await new Promise(f => setTimeout(f, 1 * 1000));
```
### Open tabs
- 0: [Checkout](http://shop.test/checkout)
- 1: (current) [Create discount](http://shop.test/admin/discounts/create)
### Page
- Page URL: http://shop.test/admin/discounts/create
- Page Title: Create discount
### Snapshot
- [Snapshot](.playwright-mcp/page-2026-05-04T02-27-22-461Z.yml)


output:
Wall time: 1.0171 seconds
Output:
[{"type":"text","text":"### Result\nWaited for 1\n### Ran Playwright code\n```js\nawait new Promise(f => setTimeout(f, 1 * 1000));\n```\n### Open tabs\n- 0: [Checkout](http://shop.test/checkout)\n- 1: (current) [Create discount](http://shop.test/admin/discounts/create)\n### Page\n- Page URL: http://shop.test/admin/discounts/create\n- Page Title: Create discount\n### Snapshot\n- [Snapshot](.playwright-mcp/page-2026-05-04T02-27-22-461Z.yml)"}]


output:
Wall time: 0.0155 seconds
Output:
[{"type":"text","text":"### Open tabs\n- 0: [Checkout](http://shop.test/checkout)\n- 1: (current) [Create discount](http://shop.test/admin/discounts/create)\n### Page\n- Page URL: http://shop.test/admin/discounts/create\n- Page Title: Create discount\n### Snapshot\n```yaml\n- generic [ref=e353]:\n  - switch \"Disabled\" [checked] [active] [ref=e354]\n  - generic [ref=e356]: Disabled\n```"}]


message: The browser smoke caught a small UI inconsistency: the active switch becomes checked, but its label remains “Disabled” before save. I’m checking the form binding before deciding whether to patch it.

phase: commentary


type: message

role: assistant

text: The browser smoke caught a small UI inconsistency: the active switch becomes checked, but its label remains “Disabled” before save. I’m checking the form binding before deciding whether to patch it.


cmd: rg -n "switch|isActive|wire:model" resources/views/livewire/admin/discounts/form.blade.php app/Livewire/Admin/Discounts/Form.php


packages: livewire/livewire livewire/flux

queries:
live model update binding
switch wire model live
flux switch checked label


command: rg -n "switch|isActive|wire:model" resources/views/livewire/admin/discounts/form.blade.php app/Livewire/Admin/Discounts/Form.php

type: search

cmd: rg -n 'switch|isActive|wire:model' resources/views/livewire/admin/discounts/form.blade.php app/Livewire/Admin/Discounts/Form.php

query: switch|isActive|wire:model

aggregated_output:
resources/views/livewire/admin/discounts/form.blade.php:19:            <flux:radio.group wire:model.live="type" label="Type" class="grid gap-3 sm:grid-cols-2">
resources/views/livewire/admin/discounts/form.blade.php:31:                        <flux:input wire:model="code" label="Discount code" placeholder="SUMMER20" />
resources/views/livewire/admin/discounts/form.blade.php:45:                <flux:radio.group wire:model.live="valueType" label="Value type" class="grid gap-3 sm:grid-cols-3">
resources/views/livewire/admin/discounts/form.blade.php:53:                        <flux:input wire:model="valueAmount" type="number" step="0.01" min="0" label="{{ $valueType === 'percent' ? 'Percentage' : 'Amount' }}" />
resources/views/livewire/admin/discounts/form.blade.php:65:                    <flux:input wire:model="minimumPurchaseAmount" type="number" step="0.01" min="0" label="Minimum purchase amount" description="Leave empty for no minimum" placeholder="0.00" />
resources/views/livewire/admin/discounts/form.blade.php:71:                        <flux:input wire:model.live.debounce.300ms="productSearch" icon="magnifying-glass" label="Specific products" placeholder="Search products..." />
resources/views/livewire/admin/discounts/form.blade.php:94:                        <flux:input wire:model.live.debounce.300ms="collectionSearch" icon="magnifying-glass" label="Specific collections" placeholder="Search collections..." />
resources/views/livewire/admin/discounts/form.blade.php:123:                <flux:input wire:model="usageLimit" type="number" min="1" label="Total usage limit" placeholder="Unlimited" />
resources/views/livewire/admin/discounts/form.blade.php:125:                    <flux:checkbox wire:model="onePerCustomer" label="Limit to one use per customer" />
resources/views/livewire/admin/discounts/form.blade.php:135:                <flux:input wire:model="startsAt" type="datetime-local" label="Start date" />
resources/views/livewire/admin/discounts/form.blade.php:136:                <flux:input wire:model="endsAt" type="datetime-local" label="End date" description="Leave empty for no end date" />
resources/views/livewire/admin/discounts/form.blade.php:145:            <flux:switch wire:model="isActive" label="{{ $isActive ? 'Active' : 'Disabled' }}" align="left" />
app/Livewire/Admin/Discounts/Form.php:53:    public bool $isActive = false;
app/Livewire/Admin/Discounts/Form.php:124:            'isActive' => ['boolean'],
app/Livewire/Admin/Discounts/Form.php:272:        $this->isActive = $discount->status !== DiscountStatus::Disabled;
app/Livewire/Admin/Discounts/Form.php:408:        if ($this->isActive) {

status: completed


output:
Chunk ID: 804d98
Wall time: 0.0000 seconds
Process exited with code 0
Original token count: 663
Output:
resources/views/livewire/admin/discounts/form.blade.php:19:            <flux:radio.group wire:model.live="type" label="Type" class="grid gap-3 sm:grid-cols-2">
resources/views/livewire/admin/discounts/form.blade.php:31:                        <flux:input wire:model="code" label="Discount code" placeholder="SUMMER20" />
resources/views/livewire/admin/discounts/form.blade.php:45:                <flux:radio.group wire:model.live="valueType" label="Value type" class="grid gap-3 sm:grid-cols-3">
resources/views/livewire/admin/discounts/form.blade.php:53:                        <flux:input wire:model="valueAmount" type="number" step="0.01" min="0" label="{{ $valueType === 'percent' ? 'Percentage' : 'Amount' }}" />
resources/views/livewire/admin/discounts/form.blade.php:65:                    <flux:input wire:model="minimumPurchaseAmount" type="number" step="0.01" min="0" label="Minimum purchase amount" description="Leave empty for no minimum" placeholder="0.00" />
resources/views/livewire/admin/discounts/form.blade.php:71:                        <flux:input wire:model.live.debounce.300ms="productSearch" icon="magnifying-glass" label="Specific products" placeholder="Search products..." />
resources/views/livewire/admin/discounts/form.blade.php:94:                        <flux:input wire:model.live.debounce.300ms="collectionSearch" icon="magnifying-glass" label="Specific collections" placeholder="Search collections..." />
resources/views/livewire/admin/discounts/form.blade.php:123:                <flux:input wire:model="usageLimit" type="number" min="1" label="Total usage limit" placeholder="Unlimited" />
resources/views/livewire/admin/discounts/form.blade.php:125:                    <flux:checkbox wire:model="onePerCustomer" label="Limit to one use per customer" />
resources/views/livewire/admin/discounts/form.blade.php:135:                <flux:input wire:model="startsAt" type="datetime-local" label="Start date" />
resources/views/livewire/admin/discounts/form.blade.php:136:                <flux:input wire:model="endsAt" type="datetime-local" label="End date" description="Leave empty for no end date" />
resources/views/livewire/admin/discounts/form.blade.php:145:            <flux:switch wire:model="isActive" label="{{ $isActive ? 'Active' : 'Disabled' }}" align="left" />
app/Livewire/Admin/Discounts/Form.php:53:    public bool $isActive = false;
app/Livewire/Admin/Discounts/Form.php:124:            'isActive' => ['boolean'],
app/Livewire/Admin/Discounts/Form.php:272:        $this->isActive = $discount->status !== DiscountStatus::Disabled;
app/Livewire/Admin/Discounts/Form.php:408:        if ($this->isActive) {


server: laravel-boost

tool: search-docs

text:
# Search Results

## Wire Model
Wire Model | livewire/livewire@4.x | Source: https://livewire.laravel.com/docs/4.x/wire-model

Livewire makes it easy to bind a component property's value with form inputs using `wire:model`.

Here is a simple example of using `wire:model` to bind the `$title` and `$content` properties with form inputs in a "Create Post" component:

```php
use Livewire\Component;
use App\Models\Post;

class CreatePost extends Component
{
    public $title = '';

    public $content = '';

    public function save()
    {
		$post = Post::create([
			'title' => $this->title
			'content' => $this->content
		]);

        // ...
    }
}
```

```blade
<form wire:submit="save">
    <label>
        <span>Title</span>

        <input type="text" wire:model="title"> <!-- [tl! highlight] -->
    </label>

    <label>
        <span>Content</span>

        <textarea wire:model="content"></textarea> <!-- [tl! highlight] -->
    </label>

	<button type="submit">Save</button>
</form>
```

Because both inputs use `wire:model`, their values will be synchronized with the server's properties when the "Save" button is pressed.

> [!warning] "Why isn't my component live updating as I type?"
> If you tried this in your browser and are confused why the title isn't automatically updating, it's because Livewire only updates a component when an "action" is submitted—like pressing a submit button—not when a user types into a field. This cuts down on network requests and improves performance. To enable "live" updating as a user types, you can use `wire:model.live` instead. [Learn more about data binding](/docs/4.x/properties#data-binding).

---

## Components Switch > flux:switch
Components Switch | livewire/flux@2.x | Source: https://fluxui.dev/components/switch#livewire/flux

flux:switch

<ui-table-scroll-area>

Prop

Description

    wire:model

Binds the switch to a Livewire property. See the wire:model documentation for more information.

    label

Label text displayed above the switch. When provided, wraps the switch in a flux:field component with an adjacent flux:label component. See the field component.

    description

Help text displayed below the switch. When provided alongside label, appears between the label and switch within the flux:field wrapper. See the field component.

    align

Alignment of the switch relative to its label. Options: right|start (default), left|end.

    disabled

Prevents user interaction with the switch.

</ui-table-scroll-area>

<ui-table-scroll-area>

Attribute

Description

    data-flux-switch

Applied to the root element for styling and identification.

    data-checked

Applied when the switch is in the "on" state.

</ui-table-scroll-area>

---

## 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 Checkbox > Checked
Components Checkbox | livewire/flux@2.x | Source: https://fluxui.dev/components/checkbox#livewire/flux

Checked

Mark a checkbox as checked by default.

<flux:checkbox checked />

---

## Attribute Modelable Modifiers
Attribute Modelable | livewire/livewire@4.x | Source: https://livewire.laravel.com/docs/4.x/attribute-modelable

## Modifiers

The parent can use `wire:model` modifiers for timing and network control:

```blade
{{-- Live updates on every keystroke --}}
<livewire:todo-input wire:model.live="todo" />

{{-- Debounce updates --}}
<livewire:todo-input wire:model.live.debounce.500ms="todo" />

{{-- Throttle updates --}}
<livewire:todo-input wire:model.live.throttle.500ms="todo" />
```

> [!note] Event-based modifiers on components
> Event-based modifiers like `.blur`, `.change`, and `.enter` control DOM events on specific elements, not reactive component bindings. To control sync timing for modelable components, place these modifiers on the actual input element inside the child component:
>
> ```blade
> {{-- Parent --}}
> <livewire:todo-input wire:model="todo" />
>
> {{-- Child component --}}
> <input wire:model.blur="value" />
> ```

---

## Forms Live-updating fields
Forms | livewire/livewire@4.x | Source: https://livewire.laravel.com/docs/4.x/forms

## Live-updating fields

By default, Livewire only sends a network request when the form is submitted (or any other [action](/docs/4.x/actions) is called), not while the form is being filled out.

Take the `post.create` component, for example. If you want to make sure the "title" input field is synchronized with the `$title` property on the backend as the user types, you may add the `.live` modifier to `wire:model` like so:

```blade
<input type="text" wire:model.live="title">
```

Now, as a user types into this field, network requests will be sent to the server to update `$title`. This is useful for things like a real-time search, where a dataset is filtered as a user types into a search box.

---

## Components Switch > Reference
Components Switch | livewire/flux@2.x | Source: https://fluxui.dev/components/switch#livewire/flux

    Reference

---

## Components Switch > Switch
Components Switch | livewire/flux@2.x | Source: https://fluxui.dev/components/switch#livewire/flux

    Switch

Toggle a setting on or off. Suitable for binary options like enabling or disabling features.

        Use switches as auto-saving controls outside forms; checkboxes otherwise.

<flux:field variant="inline">    <flux:label>Enable notifications</flux:label>    <flux:switch wire:model.live="notifications" />    <flux:error name="notifications" /></flux:field>

---

## Components Switch > Left align
Components Switch | livewire/flux@2.x | Source: https://fluxui.dev/components/switch#livewire/flux

Left align

Left align switches for more compact layouts using the align prop.

<flux:fieldset>    <flux:legend>Email notifications</flux:legend>
        <flux:switch label="Communication emails" align="left" />        <flux:switch label="Marketing emails" align="left" />        <flux:switch label="Social emails" align="left" />        <flux:switch label="Security emails" align="left" />
</flux:fieldset>

---

## Quickstart Create a Livewire component
Quickstart | livewire/livewire@4.x | Source: https://livewire.laravel.com/docs/4.x/quickstart

## Create a Livewire component

Livewire provides a convenient Artisan command to generate new components. Run the following command to make a new page component:

```shell
php artisan make:livewire pages::post.create
```

Since this component will be used as a full page, we use the `pages::` prefix to keep it organized in the pages directory.

This command will generate a new single-file component at `resources/views/pages/post/⚡create.blade.php`.

> [!info] What's with the ⚡ emoji?
> The lightning bolt makes Livewire components instantly recognizable in your editor. It's completely optional and can be disabled in your config if you prefer. See the [components documentation](/docs/4.x/components#creating-components) for more details.

---

## Components Switch > Fieldset
Components Switch | livewire/flux@2.x | Source: https://fluxui.dev/components/switch#livewire/flux

Fieldset

Group related switches within a fieldset.

<flux:fieldset>    <flux:legend>Email notifications</flux:legend>
        <flux:switch wire:model.live="communication" label="Communication emails" description="Receive emails about your account activity." />        <flux:separator variant="subtle" />        <flux:switch wire:model.live="marketing" label="Marketing emails" description="Receive emails about new products, features, and more." />        <flux:separator variant="subtle" />        <flux:switch wire:model.live="social" label="Social emails" description="Receive emails for friend requests, follows, and more." />        <flux:separator variant="subtle" />        <flux:switch wire:model.live="security" label="Security emails" description="Receive emails about your account activity and security." />
</flux:fieldset>

---

## Quickstart Install Livewire
Quickstart | livewire/livewire@4.x | Source: https://livewire.laravel.com/docs/4.x/quickstart

## Install Livewire

From the root directory of your Laravel app, run the following [Composer](https://getcomposer.org/) command:

```shell
composer require livewire/livewire
```

---

## Javascript The `Livewire` global object
Javascript | livewire/livewire@4.x | Source: https://livewire.laravel.com/docs/4.x/javascript

## The `Livewire` global object

Livewire's global object is the best starting point for interacting with Livewire from external scripts.

You can access the global `Livewire` JavaScript object on `window` from anywhere inside your client-side code.

It is often helpful to use `window.Livewire` inside a `livewire:init` event listener

### Accessing components

You can use the following methods to access specific Livewire components loaded on the current page:

```js
// Retrieve the $wire object for the first component on the page...
let component = Livewire.first()

// Retrieve a given component's `$wire` object by its ID...
let component = Livewire.find(id)

// Retrieve an array of component `$wire` objects by name...
let components = Livewire.getByName(name)

// Retrieve $wire objects for every component on the page...
let components = Livewire.all()
```

> [!info]
> Each of these methods returns a `$wire` object representing the component's state in Livewire.
>

> You can learn more about these objects in [the `$wire` documentation](#the-wire-object).

### Interacting with events

In addition to dispatching and listening for events from individual components in PHP, the global `Livewire` object allows you to interact with [Livewire's event system](/docs/4.x/events) from anywhere in your application:

```js
// Dispatch an event to any Livewire components listening...
Livewire.dispatch('post-created', { postId: 2 })

// Dispatch an event to a given Livewire component by name...
Livewire.dispatchTo('dashboard', 'post-created', { postId: 2 })

// Listen for events dispatched from Livewire components...
Livewire.on('post-created', ({ postId }) => {
    // ...
})
```

In certain scenarios, you might need to unregister global Livewire events. For instance, when working with Alpine components and `wire:navigate`, multiple listeners may be registered as `init` is called when navigating between pages. To address this, utilize the `destroy` function, automatically invoked by Alpine. Loop through all your listeners within this function to unregister them and prevent any unwanted accumulation.

```js
Alpine.data('MyComponent', () => ({
    listeners: [],
    init() {
        this.listeners.push(
            Livewire.on('post-created', (options) => {
                // Do something...
            })
        );
    },
    destroy() {
        this.listeners.forEach((listener) => {
            listener();
        });
    }
}));
```
### Using lifecycle hooks

Livewire allows you to hook into various parts of its global lifecycle using `Livewire.hook()`:

```js
// Register a callback to execute on a given internal Livewire hook...
Livewire.hook('component.init', ({ component, cleanup }) => {
    // ...
})
```

More information about Livewire's JavaScript hooks can be [found below](#javascript-hooks).

### Registering custom directives

Livewire allows you to register custom directives using `Livewire.directive()`.

Below is an example of a custom `wire:confirm` directive that uses JavaScript's `confirm()` dialog to confirm or cancel an action before it is sent to the server:

```html
<button wire:confirm="Are you sure?" wire:click="delete">Delete post</button>
```

Here is the implementation of `wire:confirm` using `Livewire.directive()`:

```js
Livewire.directive('confirm', ({ el, directive, component, cleanup }) => {
    let content =  directive.expression

    // The "directive" object gives you access to the parsed directive.
    // For example, here are its values for: wire:click.prevent="deletePost(1)"
    //
    // directive.raw = wire:click.prevent
    // directive.value = "click"
    // directive.modifiers = ['prevent']
    // directive.expression = "deletePost(1)"

    let onClick = e => {
        if (! confirm(content)) {
            e.preventDefault()
            e.stopImmediatePropagation()
        }
    }

    el.addEventListener('click', onClick, { capture: true })

    // Register any cleanup code inside `cleanup()` in the case
    // where a Livewire component is removed from the DOM while
    // the page is still active.
    cleanup(() => {
        el.removeEventListener('click', onClick)
    })
})
```

---

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

Profile switcher

_[Truncated]_


output:
Wall time: 3.2028 seconds
Output:
[{"type":"text","text":"# Search Results\n\n## Wire Model\nWire Model | livewire/livewire@4.x | Source: https://livewire.laravel.com/docs/4.x/wire-model\n\nLivewire makes it easy to bind a component property's value with form inputs using `wire:model`.\n\nHere is a simple example of using `wire:model` to bind the `$title` and `$content` properties with form inputs in a \"Create Post\" component:\n\n```php\nuse Livewire\\Component;\nuse App\\Models\\Post;\n\nclass CreatePost extends Component\n{\n    public $title = '';\n\n    public $content = '';\n\n    public function save()\n    {\n\t\t$post = Post::create([\n\t\t\t'title' => $this->title\n\t\t\t'content' => $this->content\n\t\t]);\n\n        // ...\n    }\n}\n```\n\n```blade\n<form wire:submit=\"save\">\n    <label>\n        <span>Title</span>\n\n        <input type=\"text\" wire:model=\"title\"> <!-- [tl! highlight] -->\n    </label>\n\n    <label>\n        <span>Content</span>\n\n        <textarea wire:model=\"content\"></textarea> <!-- [tl! highlight] -->\n    </label>\n\n\t<button type=\"submit\">Save</button>\n</form>\n```\n\nBecause both inputs use `wire:model`, their values will be synchronized with the server's properties when the \"Save\" button is pressed.\n\n> [!warning] \"Why isn't my component live updating as I type?\"\n> If you tried this in your browser and are confused why the title isn't automatically updating, it's because Livewire only updates a component when an \"action\" is submitted—like pressing a submit button—not when a user types into a field. This cuts down on network requests and improves performance. To enable \"live\" updating as a user types, you can use `wire:model.live` instead. [Learn more about data binding](/docs/4.x/properties#data-binding).\n\n---\n\n## Components Switch > flux:switch\nComponents Switch | livewire/flux@2.x | Source: https://fluxui.dev/components/switch#livewire/flux\n\n
flux:switch

<ui-table-scroll-area>

Prop

Description

\n    wire:model\n

Binds the switch to a Livewire property. See the wire:model documentation for more information.

\n    label\n

Label text displayed above the switch. When provided, wraps the switch in a flux:field component with an adjacent flux:label component. See the field component.

\n    description\n

Help text displayed below the switch. When provided alongside label, appears between the label and switch within the flux:field wrapper. See the field component.

\n    align\n

Alignment of the switch relative to its label. Options: right|start (default), left|end.

\n    disabled\n

Prevents user interaction with the switch.

</ui-table-scroll-area>

<ui-table-scroll-area>

Attribute

Description

\n    data-flux-switch\n

Applied to the root element for styling and identification.

\n    data-checked\n

Applied when the switch is in the \"on\" state.

</ui-table-scroll-area>

\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 Checkbox > Checked\nComponents Checkbox | livewire/flux@2.x | Source: https://fluxui.dev/components/checkbox#livewire/flux\n\n
Checked

Mark a checkbox as checked by default.

<flux:checkbox checked />

\n\n---\n\n## Attribute Modelable Modifiers\nAttribute Modelable | livewire/livewire@4.x | Source: https://livewire.laravel.com/docs/4.x/attribute-modelable\n\n## Modifiers\n\nThe parent can use `wire:model` modifiers for timing and network control:\n\n```blade\n{{-- Live updates on every keystroke --}}\n<livewire:todo-input wire:model.live=\"todo\" />\n\n{{-- Debounce updates --}}\n<livewire:todo-input wire:model.live.debounce.500ms=\"todo\" />\n\n{{-- Throttle updates --}}\n<livewire:todo-input wire:model.live.throttle.500ms=\"todo\" />\n```\n\n> [!note] Event-based modifiers on components\n> Event-based modifiers like `.blur`, `.change`, and `.enter` control DOM events on specific elements, not reactive component bindings. To control sync timing for modelable components, place these modifiers on the actual input element inside the child component:\n>\n> ```blade\n> {{-- Parent --}}\n> <livewire:todo-input wire:model=\"todo\" />\n>\n> {{-- Child component --}}\n> <input wire:model.blur=\"value\" />\n> ```\n\n---\n\n## Forms Live-updating fields\nForms | livewire/livewire@4.x | Source: https://livewire.laravel.com/docs/4.x/forms\n\n## Live-updating fields\n\nBy default, Livewire only sends a network request when the form is submitted (or any other [action](/docs/4.x/actions) is called), not while the form is being filled out.\n\nTake the `post.create` component, for example. If you want to make sure the \"title\" input field is synchronized with the `$title` property on the backend as the user types, you may add the `.live` modifier to `wire:model` like so:\n\n```blade\n<input type=\"text\" wire:model.live=\"title\">\n```\n\nNow, as a user types into this field, network requests will be sent to the server to update `$title`. This is useful for things like a real-time search, where a dataset is filtered as a user types into a search box.\n\n---\n\n## Components Switch > Reference\nComponents Switch | livewire/flux@2.x | Source: https://fluxui.dev/components/switch#livewire/flux\n\n
\n    Reference\n

\n\n---\n\n## Components Switch > Switch\nComponents Switch | livewire/flux@2.x | Source: https://fluxui.dev/components/switch#livewire/flux\n\n

\n    Switch\n

Toggle a setting on or off. Suitable for binary options like enabling or disabling features.

\n        Use switches as auto-saving controls outside forms; checkboxes otherwise.\n

<flux:field variant=\"inline\">    <flux:label>Enable notifications</flux:label>    <flux:switch wire:model.live=\"notifications\" />    <flux:error name=\"notifications\" /></flux:field>

\n\n---\n\n## Components Switch > Left align\nComponents Switch | livewire/flux@2.x | Source: https://fluxui.dev/components/switch#livewire/flux\n\n
Left align

Left align switches for more compact layouts using the align prop.

<flux:fieldset>    <flux:legend>Email notifications</flux:legend>
        <flux:switch label=\"Communication emails\" align=\"left\" />        <flux:switch label=\"Marketing emails\" align=\"left\" />        <flux:switch label=\"Social emails\" align=\"left\" />        <flux:switch label=\"Security emails\" align=\"left\" />
</flux:fieldset>

\n\n---\n\n## Quickstart Create a Livewire component\nQuickstart | livewire/livewire@4.x | Source: https://livewire.laravel.com/docs/4.x/quickstart\n\n## Create a Livewire component\n\nLivewire provides a convenient Artisan command to generate new components. Run the following command to make a new page component:\n\n```shell\nphp artisan make:livewire pages::post.create\n```\n\nSince this component will be used as a full page, we use the `pages::` prefix to keep it organized in the pages directory.\n\nThis command will generate a new single-file component at `resources/views/pages/post/⚡create.blade.php`.\n\n> [!info] What's with the ⚡ emoji?\n> The lightning bolt makes Livewire components instantly recognizable in your editor. It's completely optional and can be disabled in your config if you prefer. See the [components documentation](/docs/4.x/components#creating-components) for more details.\n\n---\n\n## Components Switch > Fieldset\nComponents Switch | livewire/flux@2.x | Source: https://fluxui.dev/components/switch#livewire/flux\n\n
Fieldset

Group related switches within a fieldset.

<flux:fieldset>    <flux:legend>Email notifications</flux:legend>
        <flux:switch wire:model.live=\"communication\" label=\"Communication emails\" description=\"Receive emails about your account activity.\" />        <flux:separator variant=\"subtle\" />        <flux:switch wire:model.live=\"marketing\" label=\"Marketing emails\" description=\"Receive emails about new products, features, and more.\" />        <flux:separator variant=\"subtle\" />        <flux:switch wire:model.live=\"social\" label=\"Social emails\" description=\"Receive emails for friend requests, follows, and more.\" />        <flux:separator variant=\"subtle\" />        <flux:switch wire:model.live=\"security\" label=\"Security emails\" description=\"Receive emails about your account activity and security.\" />
</flux:fieldset>

\n\n---\n\n## Quickstart Install Livewire\nQuickstart | livewire/livewire@4.x | Source: https://livewire.laravel.com/docs/4.x/quickstart\n\n## Install Livewire\n\nFrom the root directory of your Laravel app, run the following [Composer](https://getcomposer.org/) command:\n\n```shell\ncomposer require livewire/livewire\n```\n\n---\n\n## Javascript The `Livewire` global object\nJavascript | livewire/livewire@4.x | Source: https://livewire.laravel.com/docs/4.x/javascript\n\n## The `Livewire` global object\n\nLivewire's global object is the best starting point for interacting with Livewire from external scripts.\n\nYou can access the global `Livewire` JavaScript object on `window` from anywhere inside your client-side code.\n\nIt is often helpful to use `window.Livewire` inside a `livewire:init` event listener\n\n### Accessing components\n\nYou can use the following methods to access specific Livewire components loaded on the current page:\n\n```js\n// Retrieve the $wire object for the first component on the page...\nlet component = Livewire.first()\n\n// Retrieve a given component's `$wire` object by its ID...\nlet component = Livewire.find(id)\n\n// Retrieve an array of component `$wire` objects by name...\nlet components = Livewire.getByName(name)\n\n// Retrieve $wire objects for every component on the page...\nlet components = Livewire.all()\n```\n\n> [!info]\n> Each of these methods returns a `$wire` object representing the component's state in Livewire.\n>

\n> You can learn more about these objects in [the `$wire` documentation](#the-wire-object).\n\n### Interacting with events\n\nIn addition to dispatching and listening for events from individual components in PHP, the global `Livewire` object allows you to interact with [Livewire's event system](/docs/4.x/events) from anywhere in your application:\n\n```js\n// Dispatch an event to any Livewire components listening...\nLivewire.dispatch('post-created', { postId: 2 })\n\n// Dispatch an event to a given Livewire component by name...\nLivewire.dispatchTo('dashboard', 'post-created', { postId: 2 })\n\n// Listen for events dispatched from Livewire components...\nLivewire.on('post-created', ({ postId }) => {\n    // ...\n})\n```\n\nIn certain scenarios, you might need to unregister global Livewire events. For instance, when working with Alpine components and `wire:navigate`, multiple listeners may be registered as `init` is called when navigating between pages. To address this, utilize the `destroy` function, automatically invoked by Alpine. Loop through all your listeners within this function to unregister them and prevent any unwanted accumulation.\n\n```js\nAlpine.data('MyComponent', () => ({\n    listeners: [],\n    init() {\n        this.listeners.push(\n            Livewire.on('post-created', (options) => {\n                // Do something...\n            })\n        );\n    },\n    destroy() {\n        this.listeners.forEach((listener) => {\n            listener();\n        });\n    }\n}));\n```\n### Using lifecycle hooks\n\nLivewire allows you to hook into various parts of its global lifecycle using `Livewire.hook()`:\n\n```js\n// Register a callback to execute on a given internal Livewire hook...\nLivewire.hook('component.init', ({ component, cleanup }) => {\n    // ...\n})\n```\n\nMore information about Livewire's JavaScript hooks can be [found below](#javascript-hooks).\n\n### Registering custom directives\n\nLivewire allows you to register custom directives using `Livewire.directive()`.\n\nBelow is an example of a custom `wire:confirm` directive that uses JavaScript's `confirm()` dialog to confirm or cancel an action before it is sent to the server:\n\n```html\n<button wire:confirm=\"Are you sure?\" wire:click=\"delete\">Delete post</button>\n```\n\nHere is the implementation of `wire:confirm` using `Livewire.directive()`:\n\n```js\nLivewire.directive('confirm', ({ el, directive, component, cleanup }) => {\n    let content =  directive.expression\n\n    // The \"directive\" object gives you access to the parsed directive.\n    // For example, here are its values for: wire:click.prevent=\"deletePost(1)\"\n    //\n    // directive.raw = wire:click.prevent\n    // directive.value = \"click\"\n    // directive.modifiers = ['prevent']\n    // directive.expression = \"deletePost(1)\"\n\n    let onClick = e => {\n        if (! confirm(content)) {\n            e.preventDefault()\n            e.stopImmediatePropagation()\n        }\n    }\n\n    el.addEventListener('click', onClick, { capture: true })\n\n    // Register any cleanup code inside `cleanup()` in the case\n    // where a Livewire component is removed from the DOM while\n    // the page is still active.\n    cleanup(() => {\n        el.removeEventListener('click', onClick)\n    })\n})\n```\n\n---\n\n## Components Navbar > Profile switcher\nComponents Navbar | livewire/flux@2.x | Source: https://fluxui.dev/components/navbar#livewire/flux\n\n
Profile switcher

\n\n_[Truncated]_"}]


message: The docs confirm the switch needs a live model update if the label should reflect the new state immediately. I’m making that targeted Blade change, then I’ll rerun the affected checks and repeat the browser save path.


text: The docs confirm the switch needs a live model update if the label should reflect the new state immediately. I’m making that targeted Blade change, then I’ll rerun the affected checks and repeat the browser save path.


status: completed

input:
*** Begin Patch
*** Update File: /Users/fabianwesner/Herd/shop/resources/views/livewire/admin/discounts/form.blade.php
@@
-            <flux:switch wire:model="isActive" label="{{ $isActive ? 'Active' : 'Disabled' }}" align="left" />
+            <flux:switch wire:model.live="isActive" label="{{ $isActive ? 'Active' : 'Disabled' }}" align="left" />
*** End Patch


stdout:
Success. Updated the following files:
M /Users/fabianwesner/Herd/shop/resources/views/livewire/admin/discounts/form.blade.php

type: update

unified_diff:
@@ -144,3 +144,3 @@
         <div class="rounded-lg border border-zinc-200 bg-white p-5 dark:border-zinc-700 dark:bg-zinc-900">
-            <flux:switch wire:model="isActive" label="{{ $isActive ? 'Active' : 'Disabled' }}" align="left" />
+            <flux:switch wire:model.live="isActive" label="{{ $isActive ? 'Active' : 'Disabled' }}" align="left" />
         </div>


output: {"output":"Success. Updated the following files:\nM /Users/fabianwesner/Herd/shop/resources/views/livewire/admin/discounts/form.blade.php\n","metadata":{"exit_code":0,"duration_seconds":0.0}}


cmd: php artisan test --compact tests/Feature/Admin/DiscountManagementTest.php


cmd: php artisan route:list --except-vendor | rg "admin/discounts|admin\.discounts"


output:
Chunk ID: 9ede1c
Wall time: 0.2187 seconds
Process exited with code 0
Original token count: 5
Output:
{"result":"pass"}


command: php artisan route:list --except-vendor | rg "admin/discounts|admin\.discounts"

type: unknown

status: failed


command:
/bin/zsh
-lc
vendor/bin/pint --dirty --format agent

cmd: vendor/bin/pint --dirty --format agent

result: pass


command:
/bin/zsh
-lc
npm run build

cmd: npm run build

aggregated_output:
> build
> vite build

vite v7.3.1 building client environment for production...
transforming...
✓ 2 modules transformed.
Generated an empty chunk: "app".
rendering chunks...
computing gzip size...
public/build/manifest.json              0.33 kB │ gzip:  0.17 kB
public/build/assets/app-BrGbi8qr.css  226.28 kB │ gzip: 31.05 kB
public/build/assets/app-l0sNRNKZ.js     0.00 kB │ gzip:  0.02 kB
✓ built in 330ms


output:
Chunk ID: de8d25
Wall time: 3.2310 seconds
Process exited with code 0
Original token count: 18
Output:

  ........

  Tests:    8 passed (53 assertions)
  Duration: 3.00s


output:
Chunk ID: 1dee41
Wall time: 0.6537 seconds
Process exited with code 0
Original token count: 105
Output:

> build
> vite build

vite v7.3.1 building client environment for production...
transforming...
✓ 2 modules transformed.
Generated an empty chunk: "app".
rendering chunks...
computing gzip size...
public/build/manifest.json              0.33 kB │ gzip:  0.17 kB
public/build/assets/app-BrGbi8qr.css  226.28 kB │ gzip: 31.05 kB
public/build/assets/app-l0sNRNKZ.js     0.00 kB │ gzip:  0.02 kB
✓ built in 330ms


output:
Chunk ID: 3a110c
Wall time: 0.1708 seconds
Process exited with code 1
Original token count: 0
Output:


command: php artisan test --compact tests/Feature/Admin/DiscountManagementTest.php

aggregated_output:
  ........

  Tests:    8 passed (53 assertions)
  Duration: 3.00s


message: The switch binding patch is covered by the discount feature test and asset build. The route-list filter returned no lines with that exact `rg` pattern, so I’m checking the route names directly before going back to the browser.


text: The switch binding patch is covered by the discount feature test and asset build. The route-list filter returned no lines with that exact `rg` pattern, so I’m checking the route names directly before going back to the browser.


cmd: php artisan route:list --name=admin.discounts


cmd: rg -n "admin\.discounts|admin/discounts|Discounts" routes/web.php resources/views/layouts/app/sidebar.blade.php


command: rg -n "admin\.discounts|admin/discounts|Discounts" routes/web.php resources/views/layouts/app/sidebar.blade.php

type: search

cmd: rg -n "admin\\.discounts|admin/discounts|Discounts" routes/web.php resources/views/layouts/app/sidebar.blade.php

query: admin\.discounts|admin/discounts|Discounts

aggregated_output:
resources/views/layouts/app/sidebar.blade.php:43:                    <flux:sidebar.item icon="tag" :href="route('admin.discounts.index')" :current="request()->routeIs('admin.discounts.*')" wire:navigate>
resources/views/layouts/app/sidebar.blade.php:44:                        {{ __('Discounts') }}
routes/web.php:10:use App\Livewire\Admin\Discounts\Form as AdminDiscountForm;
routes/web.php:11:use App\Livewire\Admin\Discounts\Index as AdminDiscountsIndex;
routes/web.php:68:    Route::livewire('discounts', AdminDiscountsIndex::class)->name('discounts.index');


output:
Chunk ID: 0ba4e1
Wall time: 0.0363 seconds
Process exited with code 0
Original token count: 83
Output:

  GET|HEAD       admin/discounts admin.discounts.index › Livewire\Mechanisms …
  GET|HEAD       admin/discounts/create admin.discounts.create › Livewire\Mec…
  GET|HEAD       admin/discounts/{discount}/edit admin.discounts.edit › Livew…

                                                            Showing [3] routes


output:
Chunk ID: d165e1
Wall time: 0.0390 seconds
Process exited with code 0
Original token count: 458
Output:

  GET|HEAD   admin admin.dashboard › Livewire\Mechanisms › LivewirePageContro…
  GET|HEAD   admin/collections admin.collections.index › Livewire\Mechanisms …
  GET|HEAD   admin/collections/create admin.collections.create › Livewire\Mec…
  GET|HEAD   admin/collections/{collection}/edit admin.collections.edit › Liv…
  GET|HEAD   admin/customers admin.customers.index › Livewire\Mechanisms › Li…
  GET|HEAD   admin/customers/{customer} admin.customers.show › Livewire\Mecha…
  GET|HEAD   admin/discounts admin.discounts.index › Livewire\Mechanisms › Li…
  GET|HEAD   admin/discounts/create admin.discounts.create › Livewire\Mechani…
  GET|HEAD   admin/discounts/{discount}/edit admin.discounts.edit › Livewire\…
  GET|HEAD   admin/inventory admin.inventory.index › Livewire\Mechanisms › Li…
  GET|HEAD   admin/login admin.login › Livewire\Mechanisms › LivewirePageCont…
  POST       admin/logout ....................................... admin.logout
  GET|HEAD   admin/orders admin.orders.index › Livewire\Mechanisms › Livewire…
  GET|HEAD   admin/orders/{order} admin.orders.show › Livewire\Mechanisms › L…
  GET|HEAD   admin/products admin.products.index › Livewire\Mechanisms › Live…
  GET|HEAD   admin/products/create admin.products.create › Livewire\Mechanism…
  GET|HEAD   admin/products/{product}/edit admin.products.edit › Livewire\Mec…
  GET|HEAD   api/admin/v1/stores/{store}/orders api.admin.v1.orders.index › A…
  GET|HEAD   api/admin/v1/stores/{store}/orders/{order} api.admin.v1.orders.s…
  POST       api/admin/v1/stores/{store}/orders/{order}/fulfillments api.admi…
  POST       api/admin/v1/stores/{store}/orders/{order}/refunds api.admin.v1.…

                                                           Showing [21] routes


output:
Chunk ID: ed6053
Wall time: 0.0000 seconds
Process exited with code 0
Original token count: 141
Output:
resources/views/layouts/app/sidebar.blade.php:43:                    <flux:sidebar.item icon="tag" :href="route('admin.discounts.index')" :current="request()->routeIs('admin.discounts.*')" wire:navigate>
resources/views/layouts/app/sidebar.blade.php:44:                        {{ __('Discounts') }}
routes/web.php:10:use App\Livewire\Admin\Discounts\Form as AdminDiscountForm;
routes/web.php:11:use App\Livewire\Admin\Discounts\Index as AdminDiscountsIndex;
routes/web.php:68:    Route::livewire('discounts', AdminDiscountsIndex::class)->name('discounts.index');


command: php artisan route:list --name=admin.discounts

aggregated_output:
  GET|HEAD       admin/discounts admin.discounts.index › Livewire\Mechanisms …
  GET|HEAD       admin/discounts/create admin.discounts.create › Livewire\Mec…
  GET|HEAD       admin/discounts/{discount}/edit admin.discounts.edit › Livew…

                                                            Showing [3] routes


command:
/bin/zsh
-lc
php artisan route:list --path=admin

cmd: php artisan route:list --path=admin

aggregated_output:
  GET|HEAD   admin admin.dashboard › Livewire\Mechanisms › LivewirePageContro…
  GET|HEAD   admin/collections admin.collections.index › Livewire\Mechanisms …
  GET|HEAD   admin/collections/create admin.collections.create › Livewire\Mec…
  GET|HEAD   admin/collections/{collection}/edit admin.collections.edit › Liv…
  GET|HEAD   admin/customers admin.customers.index › Livewire\Mechanisms › Li…
  GET|HEAD   admin/customers/{customer} admin.customers.show › Livewire\Mecha…
  GET|HEAD   admin/discounts admin.discounts.index › Livewire\Mechanisms › Li…
  GET|HEAD   admin/discounts/create admin.discounts.create › Livewire\Mechani…
  GET|HEAD   admin/discounts/{discount}/edit admin.discounts.edit › Livewire\…
  GET|HEAD   admin/inventory admin.inventory.index › Livewire\Mechanisms › Li…
  GET|HEAD   admin/login admin.login › Livewire\Mechanisms › LivewirePageCont…
  POST       admin/logout ....................................... admin.logout
  GET|HEAD   admin/orders admin.orders.index › Livewire\Mechanisms › Livewire…
  GET|HEAD   admin/orders/{order} admin.orders.show › Livewire\Mechanisms › L…
  GET|HEAD   admin/products admin.products.index › Livewire\Mechanisms › Live…
  GET|HEAD   admin/products/create admin.products.create › Livewire\Mechanism…
  GET|HEAD   admin/products/{product}/edit admin.products.edit › Livewire\Mec…
  GET|HEAD   api/admin/v1/stores/{store}/orders api.admin.v1.orders.index › A…
  GET|HEAD   api/admin/v1/stores/{store}/orders/{order} api.admin.v1.orders.s…
  POST       api/admin/v1/stores/{store}/orders/{order}/fulfillments api.admi…
  POST       api/admin/v1/stores/{store}/orders/{order}/refunds api.admin.v1.…

                                                           Showing [21] routes


text:
### Ran Playwright code
```js
await page.goto('http://shop.test/admin/discounts/create');
```
### Open tabs
- 0: [Checkout](http://shop.test/checkout)
- 1: (current) [Create discount](http://shop.test/admin/discounts/create)
### Page
- Page URL: http://shop.test/admin/discounts/create
- Page Title: Create discount
### Snapshot
- [Snapshot](.playwright-mcp/page-2026-05-04T02-28-17-683Z.yml)
### Events
- New console entries: .playwright-mcp/console-2026-05-04T02-28-17-516Z.log#L1


output:
Wall time: 0.1700 seconds
Output:
[{"type":"text","text":"### Ran Playwright code\n```js\nawait page.goto('http://shop.test/admin/discounts/create');\n```\n### Open tabs\n- 0: [Checkout](http://shop.test/checkout)\n- 1: (current) [Create discount](http://shop.test/admin/discounts/create)\n### Page\n- Page URL: http://shop.test/admin/discounts/create\n- Page Title: Create discount\n### Snapshot\n- [Snapshot](.playwright-mcp/page-2026-05-04T02-28-17-683Z.yml)\n### Events\n- New console entries: .playwright-mcp/console-2026-05-04T02-28-17-516Z.log#L1"}]


target: body

text:
### Open tabs
- 0: [Checkout](http://shop.test/checkout)
- 1: (current) [Create discount](http://shop.test/admin/discounts/create)
### Page
- Page URL: http://shop.test/admin/discounts/create
- Page Title: Create discount
### Snapshot
```yaml
- generic [active] [ref=e1]:
  - generic [ref=e2]:
    - link "Shop" [ref=e4] [cursor=pointer]:
      - /url: http://shop.test/admin
      - img [ref=e6]
      - generic [ref=e8]: Shop
    - navigation [ref=e9]:
      - generic [ref=e10]:
        - generic [ref=e12]: Platform
        - link "Dashboard" [ref=e15] [cursor=pointer]:
          - /url: http://shop.test/admin
          - img [ref=e17]
          - generic [ref=e19]: Dashboard
      - generic [ref=e20]:
        - generic [ref=e22]: Products
        - generic [ref=e23]:
          - link "Products" [ref=e25] [cursor=pointer]:
            - /url: http://shop.test/admin/products
            - img [ref=e27]
            - generic [ref=e29]: Products
          - link "Collections" [ref=e31] [cursor=pointer]:
            - /url: http://shop.test/admin/collections
            - img [ref=e33]
            - generic [ref=e35]: Collections
          - link "Inventory" [ref=e37] [cursor=pointer]:
            - /url: http://shop.test/admin/inventory
            - img [ref=e39]
            - generic [ref=e41]: Inventory
      - generic [ref=e42]:
        - generic [ref=e44]: Operations
        - generic [ref=e45]:
          - link "Orders" [ref=e47] [cursor=pointer]:
            - /url: http://shop.test/admin/orders
            - img [ref=e49]
            - generic [ref=e51]: Orders
          - link "Customers" [ref=e53] [cursor=pointer]:
            - /url: http://shop.test/admin/customers
            - img [ref=e55]
            - generic [ref=e57]: Customers
          - link "Discounts" [ref=e59] [cursor=pointer]:
            - /url: http://shop.test/admin/discounts
            - img [ref=e61]
            - generic [ref=e64]: Discounts
    - navigation [ref=e66]:
      - link "Repository" [ref=e68] [cursor=pointer]:
        - /url: https://github.com/laravel/livewire-starter-kit
        - img [ref=e70]
        - generic [ref=e75]: Repository
      - link "Documentation" [ref=e77] [cursor=pointer]:
        - /url: https://laravel.com/docs/starter-kits#livewire
        - img [ref=e79]
        - generic [ref=e81]: Documentation
    - button "AA Acme Admin" [ref=e83]:
      - generic [ref=e86]: AA
      - generic [ref=e87]: Acme Admin
      - img [ref=e89]
  - generic [ref=e93]:
    - generic [ref=e94]:
      - generic [ref=e95]:
        - generic [ref=e96]: Create discount
        - paragraph [ref=e97]: Configure the promotion type, value, eligibility, limits, and dates.
      - link "Discounts" [ref=e98] [cursor=pointer]:
        - /url: http://shop.test/admin/discounts
        - img [ref=e99]
        - generic [ref=e101]: Discounts
    - generic [ref=e102]:
      - generic [ref=e104]:
        - generic [ref=e105]: Type
        - radiogroup "Type" [ref=e106]:
          - generic [ref=e107]:
            - radio "Discount code" [checked] [ref=e108]
            - generic [ref=e111]: Discount code
            - generic [ref=e112]: Customers enter a code at checkout
          - generic [ref=e113]:
            - radio "Automatic discount" [ref=e114]
            - generic [ref=e116]: Automatic discount
            - generic [ref=e117]: Applied automatically at checkout
      - generic [ref=e118]:
        - generic [ref=e119]: Code
        - generic [ref=e120]:
          - generic [ref=e122]:
            - generic [ref=e123]: Discount code
            - textbox "Discount code" [ref=e125]:
              - /placeholder: SUMMER20
          - button "Generate" [ref=e127]:
            - img [ref=e129]
            - generic [ref=e132]: Generate
      - generic [ref=e133]:
        - generic [ref=e134]: Value
        - generic [ref=e135]:
          - generic [ref=e136]:
            - generic [ref=e137]: Value type
            - radiogroup "Value type" [ref=e138]:
              - generic [ref=e139]:
                - radio "Percentage" [checked] [ref=e140]
                - generic [ref=e143]: Percentage
              - generic [ref=e144]:
                - radio "Fixed amount" [ref=e145]
                - generic [ref=e147]: Fixed amount
              - generic [ref=e148]:
                - radio "Free shipping" [ref=e149]
                - generic [ref=e151]: Free shipping
          - generic [ref=e153]:
            - generic [ref=e154]: Percentage
            - spinbutton "Percentage" [ref=e156]: "10"
      - generic [ref=e157]:
        - generic [ref=e158]: Conditions
        - generic [ref=e159]:
          - generic [ref=e161]:
            - generic [ref=e162]: Minimum purchase amount
            - generic [ref=e163]: Leave empty for no minimum
            - spinbutton "Minimum purchase amount" [ref=e165]
          - generic [ref=e166]:
            - generic [ref=e168]:
              - generic [ref=e169]: Specific products
              - generic [ref=e170]:
                - generic
                - textbox "Specific products" [ref=e171]:
                  - /placeholder: Search products...
            - generic [ref=e174]:
              - generic [ref=e175]: Specific collections
              - generic [ref=e176]:
                - generic
                - textbox "Specific collections" [ref=e177]:
                  - /placeholder: Search collections...
      - generic [ref=e179]:
        - generic [ref=e180]: Usage limits
        - generic [ref=e181]:
          - generic [ref=e182]:
            - generic [ref=e183]: Total usage limit
            - spinbutton "Total usage limit" [ref=e185]
          - generic [ref=e187]:
            - checkbox "Limit to one use per customer" [ref=e188]
            - generic [ref=e190]: Limit to one use per customer
      - generic [ref=e191]:
        - generic [ref=e192]: Active dates
        - generic [ref=e193]:
          - generic [ref=e194]:
            - generic [ref=e195]: Start date
            - textbox "Start date" [ref=e197]: 2026-05-04T02:28
          - generic [ref=e198]:
            - generic [ref=e199]: End date
            - generic [ref=e200]: Leave empty for no end date
            - textbox "End date" [ref=e202]
      - generic [ref=e204]:
        - switch "Disabled" [ref=e205]
        - generic [ref=e207]: Disabled
      - generic [ref=e209]:
        - link "Discard" [ref=e210] [cursor=pointer]:
          - /url: http://shop.test/admin/discounts
        - button "Save" [ref=e211]:
          - img [ref=e213]
          - generic [ref=e216]: Save
```


output:
Wall time: 0.0364 seconds
Output:
[{"type":"text","text":"### Open tabs\n- 0: [Checkout](http://shop.test/checkout)\n- 1: (current) [Create discount](http://shop.test/admin/discounts/create)\n### Page\n- Page URL: http://shop.test/admin/discounts/create\n- Page Title: Create discount\n### Snapshot\n```yaml\n- generic [active] [ref=e1]:\n  - generic [ref=e2]:\n    - link \"Shop\" [ref=e4] [cursor=pointer]:\n      - /url: http://shop.test/admin\n      - img [ref=e6]\n      - generic [ref=e8]: Shop\n    - navigation [ref=e9]:\n      - generic [ref=e10]:\n        - generic [ref=e12]: Platform\n        - link \"Dashboard\" [ref=e15] [cursor=pointer]:\n          - /url: http://shop.test/admin\n          - img [ref=e17]\n          - generic [ref=e19]: Dashboard\n      - generic [ref=e20]:\n        - generic [ref=e22]: Products\n        - generic [ref=e23]:\n          - link \"Products\" [ref=e25] [cursor=pointer]:\n            - /url: http://shop.test/admin/products\n            - img [ref=e27]\n            - generic [ref=e29]: Products\n          - link \"Collections\" [ref=e31] [cursor=pointer]:\n            - /url: http://shop.test/admin/collections\n            - img [ref=e33]\n            - generic [ref=e35]: Collections\n          - link \"Inventory\" [ref=e37] [cursor=pointer]:\n            - /url: http://shop.test/admin/inventory\n            - img [ref=e39]\n            - generic [ref=e41]: Inventory\n      - generic [ref=e42]:\n        - generic [ref=e44]: Operations\n        - generic [ref=e45]:\n          - link \"Orders\" [ref=e47] [cursor=pointer]:\n            - /url: http://shop.test/admin/orders\n            - img [ref=e49]\n            - generic [ref=e51]: Orders\n          - link \"Customers\" [ref=e53] [cursor=pointer]:\n            - /url: http://shop.test/admin/customers\n            - img [ref=e55]\n            - generic [ref=e57]: Customers\n          - link \"Discounts\" [ref=e59] [cursor=pointer]:\n            - /url: http://shop.test/admin/discounts\n            - img [ref=e61]\n            - generic [ref=e64]: Discounts\n    - navigation [ref=e66]:\n      - link \"Repository\" [ref=e68] [cursor=pointer]:\n        - /url: https://github.com/laravel/livewire-starter-kit\n        - img [ref=e70]\n        - generic [ref=e75]: Repository\n      - link \"Documentation\" [ref=e77] [cursor=pointer]:\n        - /url: https://laravel.com/docs/starter-kits#livewire\n        - img [ref=e79]\n        - generic [ref=e81]: Documentation\n    - button \"AA Acme Admin\" [ref=e83]:\n      - generic [ref=e86]: AA\n      - generic [ref=e87]: Acme Admin\n      - img [ref=e89]\n  - generic [ref=e93]:\n    - generic [ref=e94]:\n      - generic [ref=e95]:\n        - generic [ref=e96]: Create discount\n        - paragraph [ref=e97]: Configure the promotion type, value, eligibility, limits, and dates.\n      - link \"Discounts\" [ref=e98] [cursor=pointer]:\n        - /url: http://shop.test/admin/discounts\n        - img [ref=e99]\n        - generic [ref=e101]: Discounts\n    - generic [ref=e102]:\n      - generic [ref=e104]:\n        - generic [ref=e105]: Type\n        - radiogroup \"Type\" [ref=e106]:\n          - generic [ref=e107]:\n            - radio \"Discount code\" [checked] [ref=e108]\n            - generic [ref=e111]: Discount code\n            - generic [ref=e112]: Customers enter a code at checkout\n          - generic [ref=e113]:\n            - radio \"Automatic discount\" [ref=e114]\n            - generic [ref=e116]: Automatic discount\n            - generic [ref=e117]: Applied automatically at checkout\n      - generic [ref=e118]:\n        - generic [ref=e119]: Code\n        - generic [ref=e120]:\n          - generic [ref=e122]:\n            - generic [ref=e123]: Discount code\n            - textbox \"Discount code\" [ref=e125]:\n              - /placeholder: SUMMER20\n          - button \"Generate\" [ref=e127]:\n            - img [ref=e129]\n            - generic [ref=e132]: Generate\n      - generic [ref=e133]:\n        - generic [ref=e134]: Value\n        - generic [ref=e135]:\n          - generic [ref=e136]:\n            - generic [ref=e137]: Value type\n            - radiogroup \"Value type\" [ref=e138]:\n              - generic [ref=e139]:\n                - radio \"Percentage\" [checked] [ref=e140]\n                - generic [ref=e143]: Percentage\n              - generic [ref=e144]:\n                - radio \"Fixed amount\" [ref=e145]\n                - generic [ref=e147]: Fixed amount\n              - generic [ref=e148]:\n                - radio \"Free shipping\" [ref=e149]\n                - generic [ref=e151]: Free shipping\n          - generic [ref=e153]:\n            - generic [ref=e154]: Percentage\n            - spinbutton \"Percentage\" [ref=e156]: \"10\"\n      - generic [ref=e157]:\n        - generic [ref=e158]: Conditions\n        - generic [ref=e159]:\n          - generic [ref=e161]:\n            - generic [ref=e162]: Minimum purchase amount\n            - generic [ref=e163]: Leave empty for no minimum\n            - spinbutton \"Minimum purchase amount\" [ref=e165]\n          - generic [ref=e166]:\n            - generic [ref=e168]:\n              - generic [ref=e169]: Specific products\n              - generic [ref=e170]:\n                - generic\n                - textbox \"Specific products\" [ref=e171]:\n                  - /placeholder: Search products...\n            - generic [ref=e174]:\n              - generic [ref=e175]: Specific collections\n              - generic [ref=e176]:\n                - generic\n                - textbox \"Specific collections\" [ref=e177]:\n                  - /placeholder: Search collections...\n      - generic [ref=e179]:\n        - generic [ref=e180]: Usage limits\n        - generic [ref=e181]:\n          - generic [ref=e182]:\n            - generic [ref=e183]: Total usage limit\n            - spinbutton \"Total usage limit\" [ref=e185]\n          - generic [ref=e187]:\n            - checkbox \"Limit to one use per customer\" [ref=e188]\n            - generic [ref=e190]: Limit to one use per customer\n      - generic [ref=e191]:\n        - generic [ref=e192]: Active dates\n        - generic [ref=e193]:\n          - generic [ref=e194]:\n            - generic [ref=e195]: Start date\n            - textbox \"Start date\" [ref=e197]: 2026-05-04T02:28\n          - generic [ref=e198]:\n            - generic [ref=e199]: End date\n            - generic [ref=e200]: Leave empty for no end date\n            - textbox \"End date\" [ref=e202]\n      - generic [ref=e204]:\n        - switch \"Disabled\" [ref=e205]\n        - generic [ref=e207]: Disabled\n      - generic [ref=e209]:\n        - link \"Discard\" [ref=e210] [cursor=pointer]:\n          - /url: http://shop.test/admin/discounts\n        - button \"Save\" [ref=e211]:\n          - img [ref=e213]\n          - generic [ref=e216]: Save\n```"}]


output:
Wall time: 0.1751 seconds
Output:
[{"type":"text","text":"### Ran Playwright code\n```js\nawait page.getByRole('textbox', { name: 'Discount code' }).fill('e2esmoke');\nawait page.getByRole('spinbutton', { name: 'Percentage' }).fill('15');\nawait page.getByRole('spinbutton', { name: 'Minimum purchase amount' }).fill('25');\nawait page.getByRole('spinbutton', { name: 'Total usage limit' }).fill('3');\nawait page.getByRole('checkbox', { name: 'Limit to one use per customer' }).setChecked(true);\n```"}]


text:
### Ran Playwright code
```js
await page.getByRole('switch', { name: 'Disabled' }).click();
```
### Open tabs
- 0: [Checkout](http://shop.test/checkout)
- 1: (current) [Create discount](http://shop.test/admin/discounts/create)
### Page
- Page URL: http://shop.test/admin/discounts/create
- Page Title: Create discount
### Snapshot
- [Snapshot](.playwright-mcp/page-2026-05-04T02-28-35-545Z.yml)


output:
Wall time: 2.0773 seconds
Output:
[{"type":"text","text":"### Ran Playwright code\n```js\nawait page.getByRole('switch', { name: 'Disabled' }).click();\n```\n### Open tabs\n- 0: [Checkout](http://shop.test/checkout)\n- 1: (current) [Create discount](http://shop.test/admin/discounts/create)\n### Page\n- Page URL: http://shop.test/admin/discounts/create\n- Page Title: Create discount\n### Snapshot\n- [Snapshot](.playwright-mcp/page-2026-05-04T02-28-35-545Z.yml)"}]


text:
### Open tabs
- 0: [Checkout](http://shop.test/checkout)
- 1: (current) [Create discount](http://shop.test/admin/discounts/create)
### Page
- Page URL: http://shop.test/admin/discounts/create
- Page Title: Create discount
### Snapshot
```yaml
- generic [ref=e204]:
  - switch "Active" [checked] [active] [ref=e219]
  - generic [ref=e207]: Active
```


output:
Wall time: 0.0101 seconds
Output:
[{"type":"text","text":"### Open tabs\n- 0: [Checkout](http://shop.test/checkout)\n- 1: (current) [Create discount](http://shop.test/admin/discounts/create)\n### Page\n- Page URL: http://shop.test/admin/discounts/create\n- Page Title: Create discount\n### Snapshot\n```yaml\n- generic [ref=e204]:\n  - switch \"Active\" [checked] [active] [ref=e219]\n  - generic [ref=e207]: Active\n```"}]


element: Save discount button

text:
### Error
Error: Ref e211 not found in the current page snapshot. Try capturing new snapshot.


output:
Wall time: 0.0024 seconds
Output:
[{"type":"text","text":"### Error\nError: Ref e211 not found in the current page snapshot. Try capturing new snapshot."}]


text:
### Open tabs
- 0: [Checkout](http://shop.test/checkout)
- 1: (current) [Create discount](http://shop.test/admin/discounts/create)
### Page
- Page URL: http://shop.test/admin/discounts/create
- Page Title: Create discount
### Snapshot
```yaml
- generic [ref=e1]:
  - generic [ref=e2]:
    - link "Shop" [ref=e4] [cursor=pointer]:
      - /url: http://shop.test/admin
      - img [ref=e6]
      - generic [ref=e8]: Shop
    - navigation [ref=e9]:
      - generic [ref=e10]:
        - generic [ref=e12]: Platform
        - link "Dashboard" [ref=e15] [cursor=pointer]:
          - /url: http://shop.test/admin
          - img [ref=e17]
          - generic [ref=e19]: Dashboard
      - generic [ref=e20]:
        - generic [ref=e22]: Products
        - generic [ref=e23]:
          - link "Products" [ref=e25] [cursor=pointer]:
            - /url: http://shop.test/admin/products
          - link "Collections" [ref=e31] [cursor=pointer]:
            - /url: http://shop.test/admin/collections
          - link "Inventory" [ref=e37] [cursor=pointer]:
            - /url: http://shop.test/admin/inventory
      - generic [ref=e42]:
        - generic [ref=e44]: Operations
        - generic [ref=e45]:
          - link "Orders" [ref=e47] [cursor=pointer]:
            - /url: http://shop.test/admin/orders
          - link "Customers" [ref=e53] [cursor=pointer]:
            - /url: http://shop.test/admin/customers
          - link "Discounts" [ref=e59] [cursor=pointer]:
            - /url: http://shop.test/admin/discounts
    - navigation [ref=e66]:
      - link "Repository" [ref=e68] [cursor=pointer]:
        - /url: https://github.com/laravel/livewire-starter-kit
        - img [ref=e70]
        - generic [ref=e75]: Repository
      - link "Documentation" [ref=e77] [cursor=pointer]:
        - /url: https://laravel.com/docs/starter-kits#livewire
        - img [ref=e79]
        - generic [ref=e81]: Documentation
    - button "AA Acme Admin" [ref=e83]:
      - generic [ref=e86]: AA
      - generic [ref=e87]: Acme Admin
      - img [ref=e89]
  - generic [ref=e93]:
    - generic [ref=e94]:
      - generic [ref=e95]:
        - generic [ref=e96]: Create discount
        - paragraph [ref=e97]: Configure the promotion type, value, eligibility, limits, and dates.
      - link "Discounts" [ref=e98] [cursor=pointer]:
        - /url: http://shop.test/admin/discounts
        - img [ref=e99]
        - generic [ref=e101]: Discounts
    - generic [ref=e102]:
      - generic [ref=e104]:
        - generic [ref=e105]: Type
        - radiogroup "Type" [ref=e106]:
          - generic [ref=e107]
          - generic [ref=e113]
      - generic [ref=e118]:
        - generic [ref=e119]: Code
        - generic [ref=e120]:
          - generic [ref=e122]
          - button "Generate" [ref=e127]
      - generic [ref=e133]:
        - generic [ref=e134]: Value
        - generic [ref=e135]:
          - generic [ref=e136]
          - generic [ref=e153]
      - generic [ref=e157]:
        - generic [ref=e158]: Conditions
        - generic [ref=e159]:
          - generic [ref=e161]
          - generic [ref=e166]
      - generic [ref=e179]:
        - generic [ref=e180]: Usage limits
        - generic [ref=e181]:
          - generic [ref=e182]
          - generic [ref=e187]
      - generic [ref=e191]:
        - generic [ref=e192]: Active dates
        - generic [ref=e193]:
          - generic [ref=e194]
          - generic [ref=e198]
      - generic [ref=e204]:
        - switch "Active" [checked] [active] [ref=e219]
        - generic [ref=e207]: Active
      - generic [ref=e209]:
        - link "Discard" [ref=e210] [cursor=pointer]:
          - /url: http://shop.test/admin/discounts
        - button "Save" [ref=e211]:
          - img [ref=e213]
          - generic [ref=e216]: Save
```


output:
Wall time: 0.0152 seconds
Output:
[{"type":"text","text":"### Open tabs\n- 0: [Checkout](http://shop.test/checkout)\n- 1: (current) [Create discount](http://shop.test/admin/discounts/create)\n### Page\n- Page URL: http://shop.test/admin/discounts/create\n- Page Title: Create discount\n### Snapshot\n```yaml\n- generic [ref=e1]:\n  - generic [ref=e2]:\n    - link \"Shop\" [ref=e4] [cursor=pointer]:\n      - /url: http://shop.test/admin\n      - img [ref=e6]\n      - generic [ref=e8]: Shop\n    - navigation [ref=e9]:\n      - generic [ref=e10]:\n        - generic [ref=e12]: Platform\n        - link \"Dashboard\" [ref=e15] [cursor=pointer]:\n          - /url: http://shop.test/admin\n          - img [ref=e17]\n          - generic [ref=e19]: Dashboard\n      - generic [ref=e20]:\n        - generic [ref=e22]: Products\n        - generic [ref=e23]:\n          - link \"Products\" [ref=e25] [cursor=pointer]:\n            - /url: http://shop.test/admin/products\n          - link \"Collections\" [ref=e31] [cursor=pointer]:\n            - /url: http://shop.test/admin/collections\n          - link \"Inventory\" [ref=e37] [cursor=pointer]:\n            - /url: http://shop.test/admin/inventory\n      - generic [ref=e42]:\n        - generic [ref=e44]: Operations\n        - generic [ref=e45]:\n          - link \"Orders\" [ref=e47] [cursor=pointer]:\n            - /url: http://shop.test/admin/orders\n          - link \"Customers\" [ref=e53] [cursor=pointer]:\n            - /url: http://shop.test/admin/customers\n          - link \"Discounts\" [ref=e59] [cursor=pointer]:\n            - /url: http://shop.test/admin/discounts\n    - navigation [ref=e66]:\n      - link \"Repository\" [ref=e68] [cursor=pointer]:\n        - /url: https://github.com/laravel/livewire-starter-kit\n        - img [ref=e70]\n        - generic [ref=e75]: Repository\n      - link \"Documentation\" [ref=e77] [cursor=pointer]:\n        - /url: https://laravel.com/docs/starter-kits#livewire\n        - img [ref=e79]\n        - generic [ref=e81]: Documentation\n    - button \"AA Acme Admin\" [ref=e83]:\n      - generic [ref=e86]: AA\n      - generic [ref=e87]: Acme Admin\n      - img [ref=e89]\n  - generic [ref=e93]:\n    - generic [ref=e94]:\n      - generic [ref=e95]:\n        - generic [ref=e96]: Create discount\n        - paragraph [ref=e97]: Configure the promotion type, value, eligibility, limits, and dates.\n      - link \"Discounts\" [ref=e98] [cursor=pointer]:\n        - /url: http://shop.test/admin/discounts\n        - img [ref=e99]\n        - generic [ref=e101]: Discounts\n    - generic [ref=e102]:\n      - generic [ref=e104]:\n        - generic [ref=e105]: Type\n        - radiogroup \"Type\" [ref=e106]:\n          - generic [ref=e107]\n          - generic [ref=e113]\n      - generic [ref=e118]:\n        - generic [ref=e119]: Code\n        - generic [ref=e120]:\n          - generic [ref=e122]\n          - button \"Generate\" [ref=e127]\n      - generic [ref=e133]:\n        - generic [ref=e134]: Value\n        - generic [ref=e135]:\n          - generic [ref=e136]\n          - generic [ref=e153]\n      - generic [ref=e157]:\n        - generic [ref=e158]: Conditions\n        - generic [ref=e159]:\n          - generic [ref=e161]\n          - generic [ref=e166]\n      - generic [ref=e179]:\n        - generic [ref=e180]: Usage limits\n        - generic [ref=e181]:\n          - generic [ref=e182]\n          - generic [ref=e187]\n      - generic [ref=e191]:\n        - generic [ref=e192]: Active dates\n        - generic [ref=e193]:\n          - generic [ref=e194]\n          - generic [ref=e198]\n      - generic [ref=e204]:\n        - switch \"Active\" [checked] [active] [ref=e219]\n        - generic [ref=e207]: Active\n      - generic [ref=e209]:\n        - link \"Discard\" [ref=e210] [cursor=pointer]:\n          - /url: http://shop.test/admin/discounts\n        - button \"Save\" [ref=e211]:\n          - img [ref=e213]\n          - generic [ref=e216]: Save\n```"}]


text:
### Ran Playwright code
```js
await page.getByRole('button', { name: 'Save' }).click();
```
### Open tabs
- 0: [Checkout](http://shop.test/checkout)
- 1: (current) [Create discount](http://shop.test/admin/discounts/create)
### Page
- Page URL: http://shop.test/admin/discounts/create
- Page Title: Create discount
### Snapshot
- [Snapshot](.playwright-mcp/page-2026-05-04T02-28-54-357Z.yml)


output:
Wall time: 2.0715 seconds
Output:
[{"type":"text","text":"### Ran Playwright code\n```js\nawait page.getByRole('button', { name: 'Save' }).click();\n```\n### Open tabs\n- 0: [Checkout](http://shop.test/checkout)\n- 1: (current) [Create discount](http://shop.test/admin/discounts/create)\n### Page\n- Page URL: http://shop.test/admin/discounts/create\n- Page Title: Create discount\n### Snapshot\n- [Snapshot](.playwright-mcp/page-2026-05-04T02-28-54-357Z.yml)"}]


text:
### Open tabs
- 0: [Checkout](http://shop.test/checkout)
- 1: (current) [Create discount](http://shop.test/admin/discounts/create)
### Page
- Page URL: http://shop.test/admin/discounts/create
- Page Title: Create discount
### Snapshot
```yaml
- generic [active] [ref=e1]:
  - generic [ref=e2]:
    - link "Shop" [ref=e4] [cursor=pointer]:
      - /url: http://shop.test/admin
      - img [ref=e6]
      - generic [ref=e8]: Shop
    - navigation [ref=e9]:
      - generic [ref=e10]:
        - generic [ref=e12]: Platform
        - link "Dashboard" [ref=e15] [cursor=pointer]:
          - /url: http://shop.test/admin
          - img [ref=e17]
          - generic [ref=e19]: Dashboard
      - generic [ref=e20]:
        - generic [ref=e22]: Products
        - generic [ref=e23]:
          - link "Products" [ref=e25] [cursor=pointer]:
            - /url: http://shop.test/admin/products
            - img [ref=e27]
            - generic [ref=e29]: Products
          - link "Collections" [ref=e31] [cursor=pointer]:
            - /url: http://shop.test/admin/collections
            - img [ref=e33]
            - generic [ref=e35]: Collections
          - link "Inventory" [ref=e37] [cursor=pointer]:
            - /url: http://shop.test/admin/inventory
            - img [ref=e39]
            - generic [ref=e41]: Inventory
      - generic [ref=e42]:
        - generic [ref=e44]: Operations
        - generic [ref=e45]:
          - link "Orders" [ref=e47] [cursor=pointer]:
            - /url: http://shop.test/admin/orders
            - img [ref=e49]
            - generic [ref=e51]: Orders
          - link "Customers" [ref=e53] [cursor=pointer]:
            - /url: http://shop.test/admin/customers
            - img [ref=e55]
            - generic [ref=e57]: Customers
          - link "Discounts" [ref=e59] [cursor=pointer]:
            - /url: http://shop.test/admin/discounts
            - img [ref=e61]
            - generic [ref=e64]: Discounts
    - navigation [ref=e66]:
      - link "Repository" [ref=e68] [cursor=pointer]:
        - /url: https://github.com/laravel/livewire-starter-kit
        - img [ref=e70]
        - generic [ref=e75]: Repository
      - link "Documentation" [ref=e77] [cursor=pointer]:
        - /url: https://laravel.com/docs/starter-kits#livewire
        - img [ref=e79]
        - generic [ref=e81]: Documentation
    - button "AA Acme Admin" [ref=e83]:
      - generic [ref=e86]: AA
      - generic [ref=e87]: Acme Admin
      - img [ref=e89]
  - generic [ref=e93]:
    - generic [ref=e94]:
      - generic [ref=e95]:
        - generic [ref=e96]: Edit discount
        - paragraph [ref=e97]: Configure the promotion type, value, eligibility, limits, and dates.
      - link "Discounts" [ref=e98] [cursor=pointer]:
        - /url: http://shop.test/admin/discounts
        - img [ref=e99]
        - generic [ref=e101]: Discounts
    - generic [ref=e220]:
      - img [ref=e222]
      - generic [ref=e225]: Discount saved
    - generic [ref=e102]:
      - generic [ref=e104]:
        - generic [ref=e105]: Type
        - radiogroup "Type" [ref=e106]:
          - generic [ref=e107]:
            - radio "Discount code" [checked] [ref=e108]
            - generic [ref=e111]: Discount code
            - generic [ref=e112]: Customers enter a code at checkout
          - generic [ref=e113]:
            - radio "Automatic discount" [ref=e114]
            - generic [ref=e116]: Automatic discount
            - generic [ref=e117]: Applied automatically at checkout
      - generic [ref=e118]:
        - generic [ref=e119]: Code
        - generic [ref=e120]:
          - generic [ref=e122]:
            - generic [ref=e123]: Discount code
            - textbox "Discount code" [ref=e125]:
              - /placeholder: SUMMER20
              - text: E2ESMOKE
          - button "Generate" [ref=e127]:
            - img [ref=e129]
            - generic [ref=e132]: Generate
      - generic [ref=e133]:
        - generic [ref=e134]: Value
        - generic [ref=e135]:
          - generic [ref=e136]:
            - generic [ref=e137]: Value type
            - radiogroup "Value type" [ref=e138]:
              - generic [ref=e139]:
                - radio "Percentage" [checked] [ref=e140]
                - generic [ref=e143]: Percentage
              - generic [ref=e144]:
                - radio "Fixed amount" [ref=e145]
                - generic [ref=e147]: Fixed amount
              - generic [ref=e148]:
                - radio "Free shipping" [ref=e149]
                - generic [ref=e151]: Free shipping
          - generic [ref=e153]:
            - generic [ref=e154]: Percentage
            - spinbutton "Percentage" [ref=e156]: "15"
      - generic [ref=e157]:
        - generic [ref=e158]: Conditions
        - generic [ref=e159]:
          - generic [ref=e161]:
            - generic [ref=e162]: Minimum purchase amount
            - generic [ref=e163]: Leave empty for no minimum
            - spinbutton "Minimum purchase amount" [ref=e165]: "25.00"
          - generic [ref=e166]:
            - generic [ref=e168]:
              - generic [ref=e169]: Specific products
              - generic [ref=e170]:
                - generic
                - textbox "Specific products" [ref=e171]:
                  - /placeholder: Search products...
            - generic [ref=e174]:
              - generic [ref=e175]: Specific collections
              - generic [ref=e176]:
                - generic
                - textbox "Specific collections" [ref=e177]:
                  - /placeholder: Search collections...
      - generic [ref=e179]:
        - generic [ref=e180]: Usage limits
        - generic [ref=e181]:
          - generic [ref=e182]:
            - generic [ref=e183]: Total usage limit
            - spinbutton "Total usage limit" [ref=e185]: "3"
          - generic [ref=e187]:
            - checkbox "Limit to one use per customer" [checked] [ref=e188]:
              - img [ref=e217]
            - generic [ref=e190]: Limit to one use per customer
      - generic [ref=e191]:
        - generic [ref=e192]: Active dates
        - generic [ref=e193]:
          - generic [ref=e194]:
            - generic [ref=e195]: Start date
            - textbox "Start date" [ref=e197]: 2026-05-04T02:28
          - generic [ref=e198]:
            - generic [ref=e199]: End date
            - generic [ref=e200]: Leave empty for no end date
            - textbox "End date" [ref=e202]
      - generic [ref=e204]:
        - switch "Active" [checked] [ref=e219]
        - generic [ref=e207]: Active
      - generic [ref=e209]:
        - link "Discard" [ref=e210] [cursor=pointer]:
          - /url: http://shop.test/admin/discounts
        - button "Save" [ref=e211]:
          - img [ref=e213]
          - generic [ref=e216]: Save
```


output:
Wall time: 0.0147 seconds
Output:
[{"type":"text","text":"### Open tabs\n- 0: [Checkout](http://shop.test/checkout)\n- 1: (current) [Create discount](http://shop.test/admin/discounts/create)\n### Page\n- Page URL: http://shop.test/admin/discounts/create\n- Page Title: Create discount\n### Snapshot\n```yaml\n- generic [active] [ref=e1]:\n  - generic [ref=e2]:\n    - link \"Shop\" [ref=e4] [cursor=pointer]:\n      - /url: http://shop.test/admin\n      - img [ref=e6]\n      - generic [ref=e8]: Shop\n    - navigation [ref=e9]:\n      - generic [ref=e10]:\n        - generic [ref=e12]: Platform\n        - link \"Dashboard\" [ref=e15] [cursor=pointer]:\n          - /url: http://shop.test/admin\n          - img [ref=e17]\n          - generic [ref=e19]: Dashboard\n      - generic [ref=e20]:\n        - generic [ref=e22]: Products\n        - generic [ref=e23]:\n          - link \"Products\" [ref=e25] [cursor=pointer]:\n            - /url: http://shop.test/admin/products\n            - img [ref=e27]\n            - generic [ref=e29]: Products\n          - link \"Collections\" [ref=e31] [cursor=pointer]:\n            - /url: http://shop.test/admin/collections\n            - img [ref=e33]\n            - generic [ref=e35]: Collections\n          - link \"Inventory\" [ref=e37] [cursor=pointer]:\n            - /url: http://shop.test/admin/inventory\n            - img [ref=e39]\n            - generic [ref=e41]: Inventory\n      - generic [ref=e42]:\n        - generic [ref=e44]: Operations\n        - generic [ref=e45]:\n          - link \"Orders\" [ref=e47] [cursor=pointer]:\n            - /url: http://shop.test/admin/orders\n            - img [ref=e49]\n            - generic [ref=e51]: Orders\n          - link \"Customers\" [ref=e53] [cursor=pointer]:\n            - /url: http://shop.test/admin/customers\n            - img [ref=e55]\n            - generic [ref=e57]: Customers\n          - link \"Discounts\" [ref=e59] [cursor=pointer]:\n            - /url: http://shop.test/admin/discounts\n            - img [ref=e61]\n            - generic [ref=e64]: Discounts\n    - navigation [ref=e66]:\n      - link \"Repository\" [ref=e68] [cursor=pointer]:\n        - /url: https://github.com/laravel/livewire-starter-kit\n        - img [ref=e70]\n        - generic [ref=e75]: Repository\n      - link \"Documentation\" [ref=e77] [cursor=pointer]:\n        - /url: https://laravel.com/docs/starter-kits#livewire\n        - img [ref=e79]\n        - generic [ref=e81]: Documentation\n    - button \"AA Acme Admin\" [ref=e83]:\n      - generic [ref=e86]: AA\n      - generic [ref=e87]: Acme Admin\n      - img [ref=e89]\n  - generic [ref=e93]:\n    - generic [ref=e94]:\n      - generic [ref=e95]:\n        - generic [ref=e96]: Edit discount\n        - paragraph [ref=e97]: Configure the promotion type, value, eligibility, limits, and dates.\n      - link \"Discounts\" [ref=e98] [cursor=pointer]:\n        - /url: http://shop.test/admin/discounts\n        - img [ref=e99]\n        - generic [ref=e101]: Discounts\n    - generic [ref=e220]:\n      - img [ref=e222]\n      - generic [ref=e225]: Discount saved\n    - generic [ref=e102]:\n      - generic [ref=e104]:\n        - generic [ref=e105]: Type\n        - radiogroup \"Type\" [ref=e106]:\n          - generic [ref=e107]:\n            - radio \"Discount code\" [checked] [ref=e108]\n            - generic [ref=e111]: Discount code\n            - generic [ref=e112]: Customers enter a code at checkout\n          - generic [ref=e113]:\n            - radio \"Automatic discount\" [ref=e114]\n            - generic [ref=e116]: Automatic discount\n            - generic [ref=e117]: Applied automatically at checkout\n      - generic [ref=e118]:\n        - generic [ref=e119]: Code\n        - generic [ref=e120]:\n          - generic [ref=e122]:\n            - generic [ref=e123]: Discount code\n            - textbox \"Discount code\" [ref=e125]:\n              - /placeholder: SUMMER20\n              - text: E2ESMOKE\n          - button \"Generate\" [ref=e127]:\n            - img [ref=e129]\n            - generic [ref=e132]: Generate\n      - generic [ref=e133]:\n        - generic [ref=e134]: Value\n        - generic [ref=e135]:\n          - generic [ref=e136]:\n            - generic [ref=e137]: Value type\n            - radiogroup \"Value type\" [ref=e138]:\n              - generic [ref=e139]:\n                - radio \"Percentage\" [checked] [ref=e140]\n                - generic [ref=e143]: Percentage\n              - generic [ref=e144]:\n                - radio \"Fixed amount\" [ref=e145]\n                - generic [ref=e147]: Fixed amount\n              - generic [ref=e148]:\n                - radio \"Free shipping\" [ref=e149]\n                - generic [ref=e151]: Free shipping\n          - generic [ref=e153]:\n            - generic [ref=e154]: Percentage\n            - spinbutton \"Percentage\" [ref=e156]: \"15\"\n      - generic [ref=e157]:\n        - generic [ref=e158]: Conditions\n        - generic [ref=e159]:\n          - generic [ref=e161]:\n            - generic [ref=e162]: Minimum purchase amount\n            - generic [ref=e163]: Leave empty for no minimum\n            - spinbutton \"Minimum purchase amount\" [ref=e165]: \"25.00\"\n          - generic [ref=e166]:\n            - generic [ref=e168]:\n              - generic [ref=e169]: Specific products\n              - generic [ref=e170]:\n                - generic\n                - textbox \"Specific products\" [ref=e171]:\n                  - /placeholder: Search products...\n            - generic [ref=e174]:\n              - generic [ref=e175]: Specific collections\n              - generic [ref=e176]:\n                - generic\n                - textbox \"Specific collections\" [ref=e177]:\n                  - /placeholder: Search collections...\n      - generic [ref=e179]:\n        - generic [ref=e180]: Usage limits\n        - generic [ref=e181]:\n          - generic [ref=e182]:\n            - generic [ref=e183]: Total usage limit\n            - spinbutton \"Total usage limit\" [ref=e185]: \"3\"\n          - generic [ref=e187]:\n            - checkbox \"Limit to one use per customer\" [checked] [ref=e188]:\n              - img [ref=e217]\n            - generic [ref=e190]: Limit to one use per customer\n      - generic [ref=e191]:\n        - generic [ref=e192]: Active dates\n        - generic [ref=e193]:\n          - generic [ref=e194]:\n            - generic [ref=e195]: Start date\n            - textbox \"Start date\" [ref=e197]: 2026-05-04T02:28\n          - generic [ref=e198]:\n            - generic [ref=e199]: End date\n            - generic [ref=e200]: Leave empty for no end date\n            - textbox \"End date\" [ref=e202]\n      - generic [ref=e204]:\n        - switch \"Active\" [checked] [ref=e219]\n        - generic [ref=e207]: Active\n      - generic [ref=e209]:\n        - link \"Discard\" [ref=e210] [cursor=pointer]:\n          - /url: http://shop.test/admin/discounts\n        - button \"Save\" [ref=e211]:\n          - img [ref=e213]\n          - generic [ref=e216]: Save\n```"}]


element: Discounts link

text:
### Ran Playwright code
```js
await page.locator('section').getByRole('link', { name: 'Discounts' }).click();
```
### Open tabs
- 0: [Checkout](http://shop.test/checkout)
- 1: (current) [Discounts](http://shop.test/admin/discounts)
### Page
- Page URL: http://shop.test/admin/discounts
- Page Title: Discounts
### Snapshot
- [Snapshot](.playwright-mcp/page-2026-05-04T02-29-04-414Z.yml)


output:
Wall time: 2.0859 seconds
Output:
[{"type":"text","text":"### Ran Playwright code\n```js\nawait page.locator('section').getByRole('link', { name: 'Discounts' }).click();\n```\n### Open tabs\n- 0: [Checkout](http://shop.test/checkout)\n- 1: (current) [Discounts](http://shop.test/admin/discounts)\n### Page\n- Page URL: http://shop.test/admin/discounts\n- Page Title: Discounts\n### Snapshot\n- [Snapshot](.playwright-mcp/page-2026-05-04T02-29-04-414Z.yml)"}]