How to store multi select values in Laravel 5.2

后端 未结 3 1067
无人及你
无人及你 2020-12-29 11:55

I have a form which stores News.

Here I am using Multiselect and I want to save all the selected option in the table as say Users,staff,cinemahall as a str

3条回答
  •  渐次进展
    2020-12-29 12:04

    If you are using a multiselect, that probably means that you need a many to many relationship and a pivot table. Kind of like how posts can belong to many tags and tags can belong to many posts.

    In your case this would probably be between news and the news_types tables.

提交回复
热议问题