mirror of
https://github.com/ericasch6/scrum-poker-internal.git
synced 2026-10-13 14:52:09 +00:00
36 lines
691 B
PHP
36 lines
691 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
/**
|
|
* @property int $id
|
|
* @property int|null $user_id
|
|
* @property string $name
|
|
* @property array<int, array{key: string, label: string}> $cards
|
|
* @property bool $is_system
|
|
*/
|
|
class Deck extends Model
|
|
{
|
|
protected $fillable = [
|
|
'name',
|
|
'cards',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'cards' => 'array',
|
|
'is_system' => 'boolean',
|
|
];
|
|
}
|
|
|
|
/** @return BelongsTo<User, $this> */
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
}
|