I am exploring CakePHP's bake function and I used the latest CakePHP (3.6.1) followed some tutorials to bake the MySQL structure and it worked fine except that I expected the related fields with a foreign key constraint on my table need to be templated with the corresponding lookup field. Please tell me how I can do that.
2
votes
1 Answers
0
votes
Your table definitions and relations need to follow akePHP's Database convetions in order to be detected by bake properly.
If you are not following the conventions then I can see two other options:
(more difficult) attempt to update bake itself to work with what you have.
Use bake as it is, but after the code has been generated manually add the table relations in your code. See Linking tables together