Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2.0185 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
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 | } |
||
35 |