Completed
Push — master ( 151ac3...e86d1c )
by Nasrul Hazim
04:04
created

Address::getRouteKeyName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace CleaniqueCoders\Profile\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class Address extends Model
8
{
9
    protected $guarded = ['id'];
10
11
    /**
12
     * Get the route key for the model.
13
     *
14
     * @return string
15
     */
16
    public function getRouteKeyName()
17
    {
18
        return 'hashslug';
19
    }
20
21
    /**
22
     * Get all of the owning addressable models.
23
     */
24
    public function addressable()
25
    {
26
        return $this->morphTo();
27
    }
28
29
    /**
30
     * Get Country.
31
     *
32
     * @return \CleaniqueCoders\Profile\Models\Country
33
     */
34
    public function country()
35
    {
36
        return $this->belongsTo(Country::class);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->belongsTo(...\Models\Country::class) returns the type Illuminate\Database\Eloquent\Relations\BelongsTo which is incompatible with the documented return type CleaniqueCoders\Profile\Models\Country.
Loading history...
37
    }
38
}
39