Passed
Push — main ( 93d181...6c645c )
by PRATIK
15:49
created

Inquiry::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Adminetic\Website\Models\Admin;
4
5
use Illuminate\Database\Eloquent\Factories\HasFactory;
6
use Illuminate\Database\Eloquent\Model;
7
8
class Inquiry extends Model
9
{
10
    use HasFactory;
11
12
    protected $guarded = [];
13
14
    // Casts
15
    protected $casts = [
16
        'data' => 'array',
17
    ];
18
19
    public function __construct(array $attributes = [])
20
    {
21
        $this->table = config('website.table_prefix', 'website') . '_inquiries';
22
23
        parent::__construct($attributes);
24
    }
25
26
27
    // Relationships
28
    public function product()
29
    {
30
        return $this->belongsTo(Product::class);
31
    }
32
33
    public function software()
34
    {
35
        return $this->belongsTo(Software::class);
36
    }
37
38
    public function service()
39
    {
40
        return $this->belongsTo(Service::class);
41
    }
42
}
43