Total Complexity | 4 |
Total Lines | 24 |
Duplicated Lines | 0 % |
Coverage | 90.91% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | trait Obfuscatable |
||
10 | { |
||
11 | 3 | public function resolveRouteBinding($value, $field = null) |
|
12 | { |
||
13 | 3 | $value = App::make(Optimus::class)->decode($value); |
|
14 | 3 | $model = $this->where($field ?? $this->getRouteKeyName(), $value)->first(); |
|
15 | |||
16 | 3 | if (! is_null($model)) { |
|
17 | 3 | return $model; |
|
18 | } |
||
19 | |||
20 | throw new ModelNotFoundException(); |
||
21 | } |
||
22 | |||
23 | 15 | public function getRouteKey() |
|
28 | } |
||
29 | |||
30 | 3 | public function scopeForHash($query, $hash) |
|
35 |