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

ErrorException in Userstamps.php line 117 #6

Closed
dsnoeck opened this issue Jan 25, 2017 · 3 comments
Closed

ErrorException in Userstamps.php line 117 #6

dsnoeck opened this issue Jan 25, 2017 · 3 comments
Labels

Comments

@dsnoeck
Copy link

dsnoeck commented Jan 25, 2017

Hi,

I'm using https://github.com/sroutier/laravel-enterprise-starter-kit as base for my webapp.

It works well and save the user ID in the DB when I'm saving or updating a model. But it fails when I want to display the user in my view with $model -> creator;

ErrorException in Userstamps.php line 117:
Call to undefined method Illuminate\Auth\Guard::guard()

Any idea what could be the cause ?

@mattmcdonald-uk
Copy link
Member

This should be fixed in most recent release.

@dsnoeck
Copy link
Author

dsnoeck commented Jan 27, 2017

Thanks, but it is still not ok. the method getProvider() from \Illuminate\Auth\Guard return a userProvider object which doesn't has the method getModel():

https://laravel.com/api/5.1/Illuminate/Auth/Guard.html#method_getProvider

@mattmcdonald-uk
Copy link
Member

mattmcdonald-uk commented Jan 27, 2017

I believe this is specific to the custom user provider you're using.

In a standard Laravel 5.1 installation the method works fine.

I'd recommend you implement the creator and editor methods manually on each of your models using this trait. That would override the one provided by the trait and allow you to write custom logic that works with the specific provider you're using.

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

No branches or pull requests

2 participants