0
votes

I use Sentry 2 for auth and I created a User, Throttle and a Group Model. After i did this, i modified the config file from sentry 2 package. I use my own primary keys in the models. Instead of id, i use user_id, group_id etc.

But if i modify the group primary key, i got an exception, that column tab_groups.id was not found. But in the extended group model i overrided the primary key to group_id.

I think its a bug, because if i rename my user and throttle model, i got an exception, because the files were not found. If i rename my group model or delete this, i didn't get any exception. Sentry 2 use always his own group model.

Its a bug or i did something wrong? I created my models, modified the config. User and throttle models are working, but only the group model is not used.

1

1 Answers

-1
votes

It is a bug and found the solution at github.

If you create your own group model and you override the table or primarykey you must override the function groups in user and group model eg:

public function groups() { return $this->belongsToMany('\App\Models\Group', 'users_groups'); }