Answer the question
In order to leave comments, you need to log in
How to make in laravel so that when creating a category there is a choice of a multi-article or single-article category?
Good afternoon.
I now have a regular crud of categories with their own fields, but now I need to add a choice when creating a category, whether only one news or many news will be placed in this category. Then you need to add one more field to the category table, this is understandable. I do not quite understand how to implement logic in the same controller and how to build queries.
Answer the question
In order to leave comments, you need to log in
Personally, I don’t quite understand something else - why this might be needed at all)))
And so - make a multi field in the model
And write 0 or 1 into it
. You make a selection using where ('multi', 1) for example
If I understood the task correctly)) )
It would be better to explain what you want to get in the end
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question