Passed
Push — master ( 118848...a2adfc )
by Adam
05:55
created

Reservation::guest()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace App\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
/**
8
 * App\Models\Reservation.
9
 *
10
 * @property int $id
11
 * @property int $room_id
12
 * @property int $guest_id
13
 * @property string $date_start
14
 * @property string $date_end
15
 * @property int $people
16
 * @property \Carbon\Carbon|null $created_at
17
 * @property \Carbon\Carbon|null $updated_at
18
 * @property-read \App\Models\Guest $guest
19
 * @property-read \App\Models\Room $room
20
 *
21
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Reservation whereCreatedAt($value)
22
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Reservation whereDateEnd($value)
23
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Reservation whereDateStart($value)
24
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Reservation whereGuestId($value)
25
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Reservation whereId($value)
26
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Reservation wherePeople($value)
27
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Reservation whereRoomId($value)
28
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Reservation whereUpdatedAt($value)
29
 * @mixin \Eloquent
30
 */
31
class Reservation extends Model
32
{
33
    protected $fillable = [
34
        'room_id', 'guest_id', 'date_start', 'date_end', 'people',
35
    ];
36
37 1
    public function room()
38
    {
39 1
        return $this->belongsTo('App\Models\Room');
40
    }
41
42 1
    public function guest()
43
    {
44 1
        return $this->belongsTo('App\Models\Guest');
45
    }
46
}
47