26 lines
468 B
PHP
26 lines
468 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class CompetitionGroup extends Model
|
|
{
|
|
protected $fillable = [
|
|
'id',
|
|
'name',
|
|
'sport_id',
|
|
'country_id',
|
|
];
|
|
|
|
public function sport()
|
|
{
|
|
return $this->belongsTo(Sport::class);
|
|
}
|
|
|
|
public function country()
|
|
{
|
|
return $this->belongsTo(Country::class, 'country_id', 'tx_id')->where('disabled', 0)->where('is_country', 1);
|
|
}
|
|
}
|