Skip to content

Commit cd2993f

Browse files
authored
explicitly set user_id as the field name for relations
1 parent fdfcc72 commit cd2993f

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)