mhmiton / laravel-modules-livewire

Using Laravel Livewire in Laravel Modules package with automatically registered livewire components for every modules.
MIT License
179 stars 33 forks source link

Unable to find component #15

Closed perffy closed 2 years ago

perffy commented 2 years ago

Here is my setup:

"laravel/framework": "^8.40",
"laravel/ui": "^3.0",
"livewire/livewire": "^2.0",
"mhmiton/laravel-modules-livewire": "^1.2",
"nwidart/laravel-modules": "^8.2",
"rappasoft/laravel-livewire-tables": "^1.0",

I have created a new livewire component like this:

php artisan module:make-livewire backend.publications-table Publication --view

Here is how i load it in the HTML:

<livewire:publication::backend.publications-table />

Unfortunately I got this error:

Livewire\Exceptions\ComponentNotFoundException
Unable to find component: [publication::backend.publications-table]

All other non-module livewire components, which are located under App\Http\Livewire are working fine.

What can cause the problem?

mhmiton commented 2 years ago

Sorry for the delay. Can you send me the output after running the command, please? Also, make sure the component is created in the "Modules/Publication/Http/Livewire/Backend/PublicationsTable" path.

perffy commented 2 years ago

Unfortunately, I don't have the output after the command, but it was successful as I remember. And the path is the same, with one correction, that all my modules are located under App\Modules, which is configured in config\modules.php

Yesterday I have moved some old code to the new module and had problems with the paths. First I had trouble with the routes.php, but after some changes in the module provider that was fixed, but then the module controller was not able to find the views. This project is not pure laravel, for it I am using Laravel boilerplate from rappasoft.

In one pure laravel project with the modules package, I didn't have that problem, so I suppose the problem is caused somehow by the laravel boilerplate :(

If you have any hint what can cause this path problem, maybe I can fix it somehow, otherwise, I will need to use my old code without modules for this project.

mhmiton commented 2 years ago

Oh. Maybe there has some configuration issue. Can you share your demo project with me, please? So I will try to solve this issue in your project.

perffy commented 2 years ago

I will make a fresh installation of laravel boilerplatte and then i will install modules and modules-livewire and if it doesn't work properly i will share it so you can check it :) Thank you