Guest   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 1
Metric Value
eloc 15
c 3
b 0
f 1
dl 0
loc 42
rs 10
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A filesDir() 0 3 1
A getNameAttribute() 0 3 1
A event() 0 3 1
A getImageDimensions() 0 4 1
A getFileName() 0 3 1
A getTitleAttribute() 0 3 1
1
<?php
2
3
namespace Innoflash\Events\Models;
4
5
use FaithGen\SDK\Models\UuidModel;
6
use FaithGen\SDK\Traits\Relationships\Morphs\ImageableTrait;
7
use FaithGen\SDK\Traits\StorageTrait;
8
use Illuminate\Support\Str;
9
10
class Guest extends UuidModel
11
{
12
    use ImageableTrait, StorageTrait;
13
14
    protected $table = 'fg_guests';
15
    protected $guarded = ['id'];
16
17
    protected $hidden = [
18
        'created_at',
19
        'updated_at',
20
        'event_id',
21
    ];
22
23
    public function event()
24
    {
25
        return $this->belongsTo(Event::class);
26
    }
27
28
    public function getTitleAttribute($val)
29
    {
30
        return Str::title($val);
31
    }
32
33
    public function getNameAttribute($val)
34
    {
35
        return Str::title($val);
36
    }
37
38
    public function getFileName()
39
    {
40
        return $this->image->name;
0 ignored issues
show
Bug introduced by
The property image does not seem to exist on Innoflash\Events\Models\Guest. Are you sure there is no database migration missing?

Checks if undeclared accessed properties appear in database migrations and if the creating migration is correct.

Loading history...
41
    }
42
43
    public function filesDir()
44
    {
45
        return 'events';
46
    }
47
48
    public function getImageDimensions()
49
    {
50
        return [
51
            0, 50,
52
        ];
53
    }
54
}
55