Laravel 4: Working with relationships in seeds

前端 未结 3 554
死守一世寂寞
死守一世寂寞 2021-02-02 15:32

Is there an easy way to manage many-to-many relationships in the new seeds feature of L4?

One way would be to make a seed for the pivot table, but I would be a lot of wo

3条回答
  •  死守一世寂寞
    2021-02-02 16:17

    Seeding is for simple information, test data and static information. I wouldn't recommend using it to handle relationships. Personally, I only use it for 2 or 3 record per table, to help test my application.

    When developing your application, think about working on the data entry (admin) area first then the front end. That way you can easily add test data.

提交回复
热议问题