LaravelDaily / Laravel-AdminLTE3-Boilerplate

Boilerplate adminpanel: Laravel 6.0 + AdminLTE 3 (Bootstrap 4) and simple CRUD examples. Based on new QuickAdminPanel 2019.
https://2019.quickadminpanel.com
118 stars 57 forks source link

Error in edit path parameter #7

Open maurotello opened 4 years ago

maurotello commented 4 years ago

My question is basically if this code has a limit of use, or is free to use. Because I am using it to generate my own system, and after several models, I get an error in a parameter of the edit path of the CRUD of the model, and as much as I check I can't find the error.

Everything is fine, but when I want to edit the model it tells me that the parameter name does not correspond. For example, the update parameter is "province" and it tells me that it is "provicum".

I check but I have it well. I already cleared the route cache, the view cache, clean everything but the error still appears. I deleted the whole model and started it again and the error continues

maurotello commented 4 years ago

imagen

imagen

imagen

imagen

Me dice que está mal el parámetro, pero está bien

imagen

PovilasKorop commented 4 years ago

@desarrollostello this code of this repository is free to use. Premium version is to generate it online, at www.quickadminpanel.com

Now, with your case of provincia and provincium it's about irregular nouns and automatic singular form from plural.

Laravel core is trying to make a singular noun from URL provincia and it gets provincium. See this video: https://www.youtube.com/watch?v=fhxpoqXzKfQ

maurotello commented 4 years ago

I continue without understanding what the solution would be.

The same would be to call the Province model? because I have another model called "Zona" and it doesn't register any errors. I also have another model called "Estados" and it works correctly

maurotello commented 4 years ago

imagen

maurotello commented 4 years ago

imagen

maurotello commented 4 years ago

estado, sector, zona they work well

PovilasKorop commented 4 years ago

@desarrollostello general solution is to name your models and database tables in ENGLISH words. If you name it in other words, it may work by accident but may break.

So in your case, I would recreate all models with English language. Or, otherwise, you need to modify code to not use Laravel singular-plural "magic" (cause it works only for English), and manually specify the route binding, as in my video I've attached.

maurotello commented 4 years ago

Thanks for answering, I will name you in English. Thanks for your reply