Suggestion to refactor livewire pages and components #1062
adam-code-labx
started this conversation in
Feature Requests
Replies: 1 comment
-
The autoloading was something we wanted to look at, as the list of registered components will only get bigger and bigger. I would welcome a draft PR to suggest an approach. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently for any new livewire components these need to be registered in
AdminHubServiceProvider
There is a better way. Although livewire does not currently support registering outside the app namespace.
Dan has come up with a great solution here to autoload components which can be used as a trait
https://gist.github.com/danharrin/0e92e248c94e195a3f444d8745820c7f
He also uses for filament directly in the service provider
https://github.com/filamentphp/filament/blob/2.x/packages/admin/src/FilamentServiceProvider.php
Once the components can be auto registered in this way.
I would suggest possible cleanup for the page and components structure in the hub as there does seem to be a lot of duplication at least in the component names. in fact do we even need Livewire\Pages
Can we not call the component directly from the route then apply the layout?
Let me know if you would like me to work on a PR for this one.
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions