Closed etopian closed 6 months ago
@etopian Actually for some reason where users add custom routes it will not work because the routes param name should be equal to the name of the variable defined in controller arguments.
but I have improved within the next version 2.x Please look into the new version that will be relasing soon with Tailwind, Livewire, React, etc https://github.com/awais-vteams/laravel-crud-generator/tree/2.x
Sorry don't understand what you are saying.
I am saying when you add this route to the web.php routes file as recommended, if you use id instead of Object in Laravel it will allow for routes that match the $id variable which could be text as well as numbers. If you use Objects then it will attempt to load the object using the ID provided and if that does not work it gives a page not found:
Route::resource('servers', ServerController::class);
I got your point already and you are correct too. It will updated in the next version. Thannks
The result of using IDs instead of Model objects on Controller is that some routes are registered like for instance {table_name}/list that should return not found and will if you used Models as signatures with the recommended route.
For instance
Instead of
You can also add the Request object to the controller
These are auto-loaded by Laravel.