What's the most convenient or recommended way to organise routes and Livewire components?
I want to use Tables and Forms for flexibility. Therefor I need my own routes.
I'm using this now:
It mimics this: https://laravel.com/docs/master/controllers#actions-handled-by-resource-controller
Is this the way to go? Is there a controller resource shortcut I'm missing?
Laravel - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.
4 Replies
Nah, that looks fine.
K thanks! I've extended the question a bit... Is it typical / common practice to use a separate Edit and Create component? Could you merge them with some conditional parts? Or the other way around where you reuse some common parts like (most?) fields?
you could create a separate class that returns the array of form fields
and then use that in both the pages to avoid repeating code
Ok thanks!