kEpEx / laravel-crud-generator

php artisan command to generate fully working crud with grid paginated server side only by having database tables
MIT License
99 stars 44 forks source link

show and update returns 1 in each form field #20

Open aptvaltechtest opened 4 years ago

aptvaltechtest commented 4 years ago

I've populated my table with sample data and I can see the main list of items, I can add and delete items but if I update or show it returns a 1 in each form field.

I've done a var_dump on $company

$company = Company::findOrFail($id);

and it shows the array of the record I'm expecting but pass it to the view and it shows as described.

kEpEx commented 4 years ago

Can you share what version of laravel are you using and what database?

aptvaltechtest commented 4 years ago

My laravel version is 6.2 and it's mysql Ver 14.14 and PHP 7.2.24

little more investigation: cloned a fresh 6.2 install, created just the migration and seeder and then followed your install procedure and created a crud

Behaviour is still as described originally. I can delete records, add them but when I show the detail page the form is filled in with a '1' in each field and if I attempt to update a record it updates the record with id=1 and the contents of the fields that I fill in.

EDIT:

I resolved the show issue by removing the or '' from each isset line and it seems to resolve it (I don't know if that is the correct or best thing to do though).

The update issue remains however.