Passed
Pull Request — master (#4)
by Ostap
03:59
created

School::proposals()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace App\Models;
4
5
use Database\Factories\SchoolFactory;
6
use Illuminate\Database\Eloquent\Factories\HasFactory;
7
use Illuminate\Database\Eloquent\Model;
8
9
final class School extends Model
10
{
11
    use HasFactory;
12
13
    protected $fillable = ['name'];
14
15
    protected static function newFactory()
16
    {
17
        return SchoolFactory::new();
18
    }
19
20
    // TODO: roles
21
    public function students()
22
    {
23
        return $this->hasMany(User::class);
24
    }
25
26
    public function proposals()
27
    {
28
        return $this->hasMany(Proposal::class);
29
    }
30
}
31