laravel BelongsTo relationship with different databases not working

后端 未结 9 933
無奈伤痛
無奈伤痛 2020-12-06 00:25

I\'ve seen in several places to \"stay away\" from this, but alas - this is how my DB is built:

class Album extends Eloquent {

   // default connection

            


        
9条回答
  •  自闭症患者
    2020-12-06 00:37

    Add the connection variable with the default connection on the genre model:

    protected $connection = 'mysql';
    

    I had some problems with the relationships by not adding this.

提交回复
热议问题