-
Notifications
You must be signed in to change notification settings - Fork 22
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
Model.$with #45
base: main
Are you sure you want to change the base?
Model.$with #45
Conversation
I think this is ready now @jplhomer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work! Thank you. A couple questions:
- What's your thinking behind
$with
instead ofwith
? I know the convention is kind of there with the double-relation name thing already, but is it useful to perpetuate to all other sorts of conventions? - Does it need to be
static
? I noticed Laravel's is an instance method instead of a static method.
Nope! I swear I was getting a syntax error in my editor when doing this but I don't seem to now. That explains why I went static with it. With that said, because this is at a class level as opposed to an instance level (compared to a relationship accessor) I feel
For me I took the |
This is in response to #36
First PR so please bear with me @jplhomer!
This feels like it's been way "simpler" than I was expecting so I feel I'm almost certainly missing something.
The doc wording has been "lifted" from Laravel's docs as I'm really not that great at writing so I felt that was a good place to start. I've not used Laravel but I used Laravel's implementation as inspiration for this.
TL;DR
static $with