Added native os notifications
This commit is contained in:
+13
-3
@@ -8,6 +8,7 @@ use Illuminate\Database\Eloquent\Attributes\Fillable;
|
||||
use Illuminate\Database\Eloquent\Attributes\Hidden;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use App\Traits\HasAchievements;
|
||||
@@ -144,11 +145,20 @@ class User extends Authenticatable
|
||||
return $this->hasMany(Followee::class, 'user_id')->verified();
|
||||
}
|
||||
|
||||
public function followers(): HasMany
|
||||
public function pendingFollowers(): BelongsToMany
|
||||
{
|
||||
return $this->hasMany(Followee::class, 'followee_id')->verified();
|
||||
return $this->belongsToMany(User::class, 'followees', 'followee_id', 'user_id')
|
||||
->withPivot('verified')
|
||||
->wherePivot('verified', false)
|
||||
->withTimestamps();
|
||||
}
|
||||
public function followers(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(User::class, 'followees', 'followee_id', 'user_id')
|
||||
->withPivot('verified')
|
||||
->wherePivot('verified', true)
|
||||
->withTimestamps();
|
||||
}
|
||||
|
||||
|
||||
public function isFollowing(User $user): bool
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user