Conditions | 3 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
23 | public function forNestedSlug($nestedSlug, $with = [], $withCount = [], $scopes = []) |
||
24 | { |
||
25 | $targetSlug = collect(explode('/', $nestedSlug))->last(); |
||
26 | |||
27 | $targetItem = $this->forSlug($targetSlug, $with, $withCount, $scopes); |
||
|
|||
28 | |||
29 | if (!$targetItem || $nestedSlug !== $targetItem->nestedSlug) { |
||
30 | return null; |
||
31 | } |
||
32 | |||
33 | return $targetItem; |
||
34 | } |
||
42 |