Saturday, 15 March 2014

extend - Laravel Sentry 2 extending Group Model not working? -


I use Sentry 2 for auth and I have created a user, throttle and group model. After I did this, I modified the config files from the Sentinel 2 package. I use user_id, group_id, etc. instead of ID, I use my primary key in the model.

But if I modify the group primary key, I get an exception, that column tab_groups.id was not found. But in the extended group model I override the primary key to Group_ID.

I think this is a bug, because if I change the name of my user and throttle model, I get an exception, because the files are not found if I change the name of my group model or it Eliminate, I did not get any exceptions. Use Sentry 2 to always use your group model.

Its bug or did I do something wrong? I made my model, modified the config. Users and throttle models are working, but only the group model is not used.

This is a bug and

if you create your own group model And if you override the table or primary key, then you have to override the function groups on the user and the group model eg:

Public function group () {return $ this- & gt; Affiliation Value ('\ Application \ Model \ Group', 'users_groups'); }

No comments:

Post a Comment