-
Notifications
You must be signed in to change notification settings - Fork 349
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
Multiple database queries when using userResponsible #58
Comments
currently no, open to pull requests on the dev branch for this though, sounds handy |
+1 |
+1 Why closed? |
Closed since nobody decided it was important enough to work on, will re-open so someone can work on this and submit a pull request |
My workaround for now in my Basemodel:
|
Is there a reason this doesn't work? (from Laravel docs)
|
Just to expand slightly on @mmodler response as it did lead me in the right direction. Create a Revision class of your own extending \Venturecraft\Revisionable\Revision.
then add function revisionHistoryWithUser() as @mmodler said @InstanceOfMichael I don't believe that will work as userResponsible is not defined as a relationship of Revision. |
That seems likely, I think defining that use relationship was probably one of the first things I did. |
+1 |
1 similar comment
+1 |
as @warksit pointed it out. You can make it more simple just by using the relation. Extends Revision and put the following code:
In your application you can use it like $revision->user instead of $revision->userResponsible(). And just as relations you can do your eager load as you would do with eloquent models. |
Is there some way to eager load the username when using Revisionable to get the userResponsible for the revision?
(By the way: I am using Sentry)
The text was updated successfully, but these errors were encountered: