Passed
Push — master ( 228108...ad6a40 )
by Alexandr
02:35
created

GetAdminLink::getAdminUrlAttribute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Larrock\Core\Traits;
4
5
use Cache;
6
use Larrock\Core\Models\Seo;
7
8
trait GetAdminLink
9
{
10
    public function getAdminUrlAttribute()
11
    {
12
        $cache_key = sha1('getAdminUrlAttribute'.$this->id.$this->config->name);
13
14
        return Cache::rememberForever($cache_key, function () {
15
            return '/admin/'. $this->config->name .'/'. $this->id .'/edit';
16
        });
17
    }
18
}
19