How is a pivot table created by Laravel?

后端 未结 5 1470

In Laravel 4, when working with many-to-many relationships as described in the 4.2 docs, how can I actually get Laravel to create the pivot table for me?

Do I need

5条回答
  •  粉色の甜心
    2020-12-13 02:27

    I use Jeffrey Way's Laravel-4-Generators or Laravel-5-Generators-Extended.

    then you can just use this artisan command:

    php artisan generate:pivot table_one table_two
    

提交回复
热议问题