'Laravel livewire, unable to locate component in subfolder
Folder structure:
Livewire
- Things
- Addthing.php
Blade file
@livewire('things.addthing')
is unable to locate it: Unable to find component: [things.addthing]
Without subdirectory, this works fine as:
Livewire
- Addthing.php
.
@livewire('addthing')
How do I get Livewire components to work in a subdirectory?
Solution 1:[1]
It should work like this, did you also update your namespace to match the path?
For example:
namespace App\Http\Livewire\Things;
Solution 2:[2]
I referenced it as @livewire('things.addthings') in the blade and it worked maybe check your typo.
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 | Hiighsky |
| Solution 2 | ouflak |
