31 lines
513 B
PHP
31 lines
513 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Element 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);
|
|
}
|
|
|
|
public function element_group()
|
|
{
|
|
return $this->belongsTo(ElementGroup::class, 'id', 'element_id');
|
|
}
|
|
}
|