Test Failed
Push — master ( 2dcdef...5f4570 )
by Julien
03:01
created

Team::rounds()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Xoco70\KendoTournaments\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class Team extends Model
8
{
9
10
    protected $table = 'team';
11
    public $timestamps = true;
12
    protected $fillable = ['name', 'championship_id'];
13
14
15
    /**
16
     * A Team belongs to a Championship
17
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
18
     */
19
    public function championship()
20
    {
21
        return $this->belongsTo(Championship::class);
22
    }
23
24
    /**
25
     * @return \Illuminate\Database\Eloquent\Relations\HasManyThrough
26
     */
27
    public function category()
28
    {
29
        return $this->hasManyThrough(Category::class, Championship::class);
30
    }
31
32
    public function rounds()
33
    {
34
        return $this->belongsToMany(Round::class,'round_team');
35
    }
36
37
}