vendredi 29 décembre 2017

Laravel Validation - how to return the same category and subcategory that had been selected?

Good evening, I'm developing a form that contains categories and subcategories, the subcategories only appear after the category has been selected. So far so good, when the form is submitted and contains some validation error handled by the validation method, the system returns to the form screen with all the fields except the sub category field that is requested when the category is chosen. ..

How do I do when an error occurs and return to the form screen come with the same subcategory options that had been selected?

Note: I have a provider that sends the categories to the view, but I do not know how to retrieve the category_id to send the subcategories, nor do I know if this would be the best way ...



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire