Skip to content

Commit 5370ce9

Browse files
authoredAug 18, 2016
Merge pull request #18 from tomschlick/patch-1
explicitly set user_id as the field name for relations
2 parents 8a091eb + cd2993f commit 5370ce9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/HasApiTokens.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ trait HasApiTokens
1818
*/
1919
public function clients()
2020
{
21-
return $this->hasMany(Client::class);
21+
return $this->hasMany(Client::class, 'user_id');
2222
}
2323

2424
/**
2525
* Get all of the access tokens for the user.
2626
*/
2727
public function tokens()
2828
{
29-
return $this->hasMany(Token::class)->orderBy('created_at', 'desc');
29+
return $this->hasMany(Token::class, 'user_id')->orderBy('created_at', 'desc');
3030
}
3131

3232
/**

0 commit comments

Comments
 (0)
Please sign in to comment.