Guest::getImageDimensions()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 4
rs 10
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