Files
nuhodds_fi4/app/Models/CompetitionGroup.php
T
2026-02-13 13:33:17 +01:00

37 lines
643 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class CompetitionGroup extends Model
{
protected $fillable = [
'id',
'name',
'sport_id',
'country_id',
'level',
];
public function event()
{
return $this->belongsTo(Event::class, 'id', 'competition_group_id');
}
public function getFullNameAttribute()
{
return $this->country->name.' '.$this->name;
}
public function sport()
{
return $this->belongsTo(Sport::class);
}
public function country()
{
return $this->belongsTo(Country::class);
}
}