Completed
Push — master ( 33fa22...fb5d13 )
by Faiq
28s
created

City::doctor()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 2
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace App;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class City extends Model
8
{
9
    /**
10
     * @var string
11
     */
12
    protected $table = 'cities';
13
14
    /**
15
     * @var string
16
     */
17
    public $primarykey = 'id';
18
19
    /**
20
     * @var bool
21
     */
22
    public $timestamp = true;
23
24
    /**
25
     * @var array
26
     */
27
    protected $dates = [
28
        'created_at',
29
        'updated_at'
30
    ];
31
32
    /**
33
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
34
     */
35
    public function hospital()
36
    {
37
        return $this->hasMany('App\Hospital');
38
    }
39
40
    public function doctor() {
41
        return $this->hasOne('App\Doctor', 'city_id');
42
    }
43
}
44