UserModel::extend(function ($model) {
$model->belongsToMany['clusters'] = [
Cluster::class,
'table' => 'initbiz_cumuluscore_cluster_user',
'order' => 'full_name',
'key' => 'cluster_id',
'otherKey' => 'user_id'
];
});
'key' => 'cluster_id',
'otherKey' => 'user_id'
should be
'key' => 'user_id',
'otherKey' => 'cluster_id'
I have no idea how to fix it with migrations :D I just changed keys straight in the init.php! And all is good because the database is fresh just user 1 and cluster 1 :D
Last updated