Updated Map View
This commit is contained in:
+19
-6
@@ -48,6 +48,10 @@ class User extends Authenticatable
|
||||
$this->update(['settings' => array_merge($current, $values)]);
|
||||
}
|
||||
|
||||
function updateSetting($settingName, $value) : void{
|
||||
$this->updateSettings([$settingName => $value]);
|
||||
}
|
||||
|
||||
protected function resolvedSettings(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
@@ -80,11 +84,6 @@ class User extends Authenticatable
|
||||
return $this->where('name', 'ilike', $value)->firstOrFail();
|
||||
}
|
||||
|
||||
public function FlightController(): UserFlightController
|
||||
{
|
||||
return new UserFlightController($this);
|
||||
}
|
||||
|
||||
public function flights(): HasMany {
|
||||
return $this->hasMany(UserFlight::class);
|
||||
}
|
||||
@@ -114,7 +113,21 @@ class User extends Authenticatable
|
||||
|
||||
public function isFollowing(User $user): bool
|
||||
{
|
||||
return $this->following()->where('followee_id', $user->id)->exists();
|
||||
return $this->following()
|
||||
->where('followee_id', $user->id)
|
||||
->verified()
|
||||
->exists();
|
||||
}
|
||||
|
||||
public function followStatus(User $user): string
|
||||
{
|
||||
$followee = $this->following()->where('followee_id', $user->id)->first();
|
||||
|
||||
if (!$followee) {
|
||||
return 'none';
|
||||
}
|
||||
|
||||
return $followee->verified ? 'following' : 'requested';
|
||||
}
|
||||
|
||||
public function notifications(): HasMany
|
||||
|
||||
Reference in New Issue
Block a user