Completed
Push — master ( 3c5480...50295b )
by Adam
06:57
created

Guest::getFullNameAttribute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
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\Guest.
9
 *
10
 * @property int $id
11
 * @property string $first_name
12
 * @property string $last_name
13
 * @property string $address
14
 * @property string $zip_code
15
 * @property string $place
16
 * @property string $PESEL
17
 * @property string|null $contact
18
 * @property \Carbon\Carbon|null $created_at
19
 * @property \Carbon\Carbon|null $updated_at
20
 * @property-read string $full_name
21
 *
22
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Guest whereAddress($value)
23
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Guest whereContact($value)
24
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Guest whereCreatedAt($value)
25
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Guest whereFirstName($value)
26
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Guest whereId($value)
27
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Guest whereLastName($value)
28
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Guest wherePESEL($value)
29
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Guest wherePlace($value)
30
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Guest whereUpdatedAt($value)
31
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Guest whereZipCode($value)
32
 * @mixin \Eloquent
33
 */
34
class Guest extends Model
35
{
36
    protected $fillable = [
37
        'first_name', 'last_name', 'address', 'zip_code', 'place', 'PESEL', 'contact',
38
    ];
39
40
    /**
41
     * Get the user's full name.
42
     *
43
     * @return string
44
     */
45
    public function getFullNameAttribute()
46
    {
47
        return "{$this->first_name} {$this->last_name}";
48
    }
49
}
50