search

Home  >  Q&A  >  body text

php - There are multiple databases in laravel. How to use multiple databases in ORM?

Using DB, you can use multiple databases using connection('mysql')

But what if you use multiple databases when using ORM?

滿天的星座滿天的星座2810 days ago691

reply all(2)I'll reply

  • 天蓬老师

    天蓬老师2017-05-16 13:00:21

    When you create a Model, you can specify the connection.

    protected $connection = 'connection-name';

    That’s it.

    reply
    0
  • PHP中文网

    PHP中文网2017-05-16 13:00:21

    Reference https://www.36nu.com/question/34

    reply
    0
  • Cancelreply