51 lines
1.1 KiB
PHP
51 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use MongoDB\Laravel\Eloquent\Model;
|
|
|
|
class StatistikoDetail extends Model
|
|
{
|
|
protected $connection = 'mongodb';
|
|
|
|
protected $table = 'details';
|
|
|
|
protected $fillable = [
|
|
'ss_player_id',
|
|
'ss_team_id',
|
|
'tx_team_id',
|
|
'player_name',
|
|
'ss_national_team_id',
|
|
'birthdate',
|
|
'height',
|
|
'nationality',
|
|
'position',
|
|
'preferred_foot',
|
|
'last_update',
|
|
'created_at',
|
|
'updated_at',
|
|
];
|
|
|
|
protected $casts = [
|
|
'last_update' => 'datetime',
|
|
];
|
|
|
|
// public function season()
|
|
// {
|
|
// return $this->hasMany(SofaScorePlayerPerSeason::class, 'ss_player_id', 'ss_player_id');
|
|
// }
|
|
|
|
public function team(): BelongsTo
|
|
{
|
|
return $this->belongsTo(SofaScoreRosa::class, 'ss_team_id', 'ss_team_id');
|
|
}
|
|
|
|
public function positions(): BelongsTo
|
|
{
|
|
return $this->belongsTo(SofaScorePlayerPosition::class, 'position', 'ss_code');
|
|
}
|
|
}
|