mirror of
https://github.com/ericasch6/scrum-poker-internal.git
synced 2026-10-13 16:12:09 +00:00
kick forever
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
@@ -16,7 +15,6 @@ use Illuminate\Support\Carbon;
|
||||
* @property string $name
|
||||
* @property bool $is_moderator
|
||||
* @property Carbon|null $last_seen_at
|
||||
* @property Carbon|null $inactive_at
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property-read Room $room
|
||||
@@ -30,7 +28,6 @@ class Player extends Model
|
||||
'name',
|
||||
'is_moderator',
|
||||
'last_seen_at',
|
||||
'inactive_at',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
@@ -38,7 +35,6 @@ class Player extends Model
|
||||
return [
|
||||
'is_moderator' => 'boolean',
|
||||
'last_seen_at' => 'datetime',
|
||||
'inactive_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -85,14 +81,4 @@ class Player extends Model
|
||||
'last_seen_at' => now(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Builder<Player> $query
|
||||
* @return Builder<Player>
|
||||
*/
|
||||
public function scopeActive(Builder $query): Builder
|
||||
{
|
||||
return $query->whereNull('inactive_at');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,12 +93,6 @@ class Room extends Model
|
||||
|
||||
}
|
||||
|
||||
/** @return HasMany<Player, $this> */
|
||||
public function activePlayers(): HasMany
|
||||
{
|
||||
return $this->hasMany(Player::class)->whereNull('inactive_at');
|
||||
}
|
||||
|
||||
/** @return BelongsTo<User, $this> */
|
||||
public function owner(): BelongsTo
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user