for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Lib\DsManager\Models\Orm;
/**
* Class Match
* @package App\Lib\DsManager\Models\Orm
*/
class Match extends DsManagerOrm
{
* @var string
protected $table = 'matches';
* @var array
protected $fillable = [
'home_team_id',
'away_team_id',
'league_round_id'
];
protected $hidden = [
'created_at',
'updated_at',
'winner_id',
'loser_id',
'is_draw',
protected $casts = [
'simulated' => 'boolean'
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
public function homeTeam()
return $this->belongsTo(Team::class, 'home_team_id');
}
public function awayTeam()
return $this->belongsTo(Team::class, 'away_team_id');
public function scopeTeams($query)
return $query->with(
'homeTeam',
'awayTeam'
);
public function scopeComplete($query)
'homeTeam.roster',
'homeTeam.coach',
'awayTeam',
'awayTeam.roster',
'awayTeam.coach'