Test Setup Failed
Push — main ( 339976...030ca0 )
by Mohamed
04:11
created

ContactMessage   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 63
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 63
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 3 1
1
<?php
2
3
namespace App\Models;
4
5
use App\Http\Resources\ContactMessageResource;
6
use App\Traits\Hashidable;
7
use Illuminate\Database\Eloquent\Model;
8
9
class ContactMessage extends Model
10
{
11
    use Hashidable;
12
13
    /**
14
     * The table associated with the model.
15
     *
16
     * @var string
17
     */
18
    protected $table = 'contact_messages';
19
20
    /**
21
     * The attributes that are mass assignable.
22
     *
23
     * @var array
24
     */
25
    protected $fillable = [
26
        'name',
27
        'email',
28
        'position',
29
        'subject',
30
        'body',
31
    ];
32
33
    /**
34
     * The accessors to append to the model's array form.
35
     *
36
     * @var array
37
     */
38
    protected $appends = ['hashed_id'];
39
40
    /*
41
     * ----------------------------------------------------------------- *
42
     * --------------------------- Accessors --------------------------- *
43
     * ----------------------------------------------------------------- *
44
     */
45
46
    /*
47
     * ----------------------------------------------------------------- *
48
     * ---------------------------- Mutators --------------------------- *
49
     * ----------------------------------------------------------------- *
50
     */
51
52
    /*
53
     * ----------------------------------------------------------------- *
54
     * ----------------------------- Scopes ---------------------------- *
55
     * ----------------------------------------------------------------- *
56
     */
57
58
    /*
59
     * ----------------------------------------------------------------- *
60
     * ------------------------------ Misc ----------------------------- *
61
     * ----------------------------------------------------------------- *
62
     */
63
64
    /**
65
     * Convert the model instance to an array.
66
     *
67
     * @return array
68
     */
69
    public function toArray()
70
    {
71
        return ContactMessageResource::make($this)->toArray(request());
72
    }
73
}
74