Session api token validation
This commit is contained in:
+3
-3
@@ -140,19 +140,19 @@ class User extends Authenticatable
|
||||
|
||||
public function following(): HasMany
|
||||
{
|
||||
return $this->hasMany(Followee::class, 'user_id');
|
||||
return $this->hasMany(Followee::class, 'user_id')->verified();
|
||||
}
|
||||
|
||||
public function followers(): HasMany
|
||||
{
|
||||
return $this->hasMany(Followee::class, 'followee_id');
|
||||
return $this->hasMany(Followee::class, 'followee_id')->verified();
|
||||
}
|
||||
|
||||
|
||||
public function isFollowing(User $user): bool
|
||||
{
|
||||
return $this->following()
|
||||
->where('followee_id', $user->id)
|
||||
->verified()
|
||||
->exists();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user