I am starting to work with Laravel 5.8. and although I am making good progress there are issues that I cannot control, so I ask you for help to see if someone can tell me what should be done.
I am developing a CRUD that, among many other relationships and tables, has a table of categories and another of subcategories with a 1:N relationship.
When I register a new subcategory in the corresponding form, I have a select in which I indicate the category to which it belongs, which stores the id corresponding to the selected category in the subcategories table.
My problem comes when I want to edit said record. How should I do so that when editing the record the select shows selected the category to which said subcategory belongs.
I hope I have explained clearly.
Greetings and thanks in advance to all.
In your controller you must send to the view the model you want to edit and all the categories
and in the view you must make a form similar to create