34 lines
657 B
PHP
Executable File
34 lines
657 B
PHP
Executable File
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class GameSession extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = ['session_name', 'palette_id', 'image_path', 'ended_at'];
|
|
|
|
public function palette()
|
|
{
|
|
return $this->belongsTo(Palette::class);
|
|
}
|
|
|
|
public function commands()
|
|
{
|
|
return $this->hasMany(CommandHistory::class);
|
|
}
|
|
|
|
public function currentState()
|
|
{
|
|
return $this->hasMany(CurrentState::class);
|
|
}
|
|
|
|
public function winningState()
|
|
{
|
|
return $this->hasMany(WinningState::class);
|
|
}
|
|
}
|