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

Inquiry   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A service() 0 3 1
A product() 0 3 1
A software() 0 3 1
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