jamesdordoy / laravel-vue-datatable

Vue.js Datatable made for Laravel
https://jamesdordoy.github.io/laravel-vue-datatable
MIT License
151 stars 52 forks source link

Duplicated Key in $dataTableRelationships #131

Closed hobbydev71 closed 2 years ago

hobbydev71 commented 3 years ago

protected $dataTableRelationships = [ "belongsTo" => [ 'user' => [ "model" => Customer::class, 'foreign_key' => 'user_id', 'columns' => [ 'name' => [ 'searchable' => true, 'orderable' => true, ], ], ], 'team' => [ "model" => Protocol::class, 'foreign_key' => 'team_id', 'columns' => [ 'name' => [ 'searchable' => true, 'orderable' => true, ], ], ], 'team_schedule' => [ "model" => ProtocolSchedule::class, 'foreign_key' => 'team_id', 'columns' => [ 'start_date' => [ 'orderable' => true, ], ], ], ], }

I tried above code ,but get error like this. message: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'team_id'

Protocol, ProtocolSchedule has the column team_id. How can I solve this issue?