'$trigger - error with <x-dropdown> in Laravel Breeze
<x-dropdown class="form-control" id="exampleFormControlSelect1">
<xd-item>1</xd-item>
<xd-item>2</xd-item>
</x-dropdown>
When using this code in Laravel breeze, I get the error "Undefined variable $trigger". What is causing the error and how do I solve it?
Solution 1:[1]
The error of trigger comes because you need specify inside x-dropdown the tag x-slot with name property trigger
<x-slot name="trigger"><label>Drop Example</label></x-slot>
Remember define the property align and width for x-dropdown and for the options you need specify inside the dropdown tag another x-slot with the name content
<x-slot name="content"><x-dropdown-link>Option1</x-dropdown-link></x-slot>
You can read in this link, i used into my project too https://webmobtuts.com/backend-development/building-a-simple-cms-with-laravel-breeze/
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Eduardo Rotundo |