mirror of
https://github.com/ericasch6/scrum-poker-internal.git
synced 2026-10-13 14:12:08 +00:00
40 lines
712 B
PHP
40 lines
712 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
|
|
class Player extends Model
|
|
{
|
|
protected $fillable = [
|
|
'room_id',
|
|
'name',
|
|
'is_moderator',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'is_moderator' => 'boolean',
|
|
];
|
|
}
|
|
|
|
public function room(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Room::class);
|
|
}
|
|
|
|
public function votes(): HasMany
|
|
{
|
|
return $this->hasMany(Vote::class);
|
|
}
|
|
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
}
|