Closed manojdhrma closed 11 months ago
@manojdhrma Did you try the full page component? Also, can you share with me your dummy source code, please? So, I will test this issue properly on my end.
@mhmiton Yes. Actually this is a full page component.
It's easier to create a repo, so I created one specifically for this purpose so you can get the full source code https://github.com/manojdhrma/Laravel-modules-livewire--TestApp-
Are you sure that the resource route is supported by Livewire? I think the resource route is not supported on the livewire.
On the livewire full-page component, you need to declare the render method. So, if you using the render method, the route should be -
Route::get('test', HomeController::class)->name('test.index');
For the resource route things, you can use this, according the the livewire docs - https://livewire.laravel.com/docs/components#full-page-components
Route::get('test', TestIndex::class)->name('test.index');
Route::get('test/create', TestCreate::class)->name('test.create');
Route::get('test/edit/{id}', TestEdit::class)->name('test.edit');
Yes. I check it and you are correct.! Livewire does not support the resource route.
This is the primary problem. As you explained, I used the get route and it started working smoothly. And it seems, Laravel-modules only accepting resource route to the default controllers.
Thank you for clearing up the confusion.
The following issues happened when trying to use.
After creating a Livewire component.. the route cannot access it. It says Target Class does not exist. Actually this didn't happen before. But, it works by removing the default $moduleNamespace from the RouteServiceProvider of the "module".
Then, BadMethodCallException comes.
Error::
Before it actually works with livewire default render() method but now it requires index() method by default. It works by changing the livewire render() method to index().
Error::
Livewire Component
Blade file
I am able to re-create these issues using fresh installation.
Is there something required to be modified manually to resolve these issues ?