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

GetAdminLink   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getAdminUrlAttribute() 0 6 1
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