Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflict with eloquence #314

Closed
Remo opened this issue Oct 23, 2018 · 1 comment
Closed

Conflict with eloquence #314

Remo opened this issue Oct 23, 2018 · 1 comment

Comments

@Remo
Copy link

Remo commented Oct 23, 2018

I've got a problem with another library called eloquence.

This line https://github.com/santigarcor/laratrust/blob/master/src/Helper.php#L172 causes a "Call to a member function setAttribute() on null" error.

This only happens if eloquence is installed too. Eloquence installs a library called hookable which overrides the setAttribute method. Here's how that methods looks like: https://github.com/jarektkaczyk/hookable/blob/5.6/src/Hookable.php#L98-L115

I see two ways to fix this:

  1. Turn the setAttribute method in eloquence fluent Conflict with laratrust jarektkaczyk/hookable#22
  2. Change this $model->setAttribute($primaryKey, $data[$primaryKey])->setAttribute('name', $data['name']); to $model->setAttribute($primaryKey, $data[$primaryKey]); $model->setAttribute('name', $data['name']);
@santigarcor
Copy link
Owner

It should be fixed in that library. In the Laravel api the setAttribute method is fluent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants