Comments & Discussion
TR
How can I use form request classes when I have different rules depending on the state of an object?
A simple example might be a post in a blog. We have three properties: title, text and state. If the state is "draft" only the title is required. If state is "published" title and text should be required.
PK
PK
Ok published the article about it: Laravel Conditional Validation Based on Other Fields: 4 Examples
M
Hello. Can I reuse that form request in the Web, Api and console routes? I thought that form request only work for Web route.
please can we get a link to the project file you are working with in this course so that following along can be moe efficient?
To be honest, I didn't save any repositories for this course because they were all separate small experiments, relatively easy to re-create if needed.