| Conditions | 7 |
| Paths | 5 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | public function passes($attribute, $value) |
||
| 29 | { |
||
| 30 | if (! str_contains($value, ',')) return false; |
||
| 31 | |||
| 32 | $values = explode(',', $value); |
||
| 33 | if (count($values) !== 2) return false; |
||
| 34 | |||
| 35 | $type = $values[ 0 ]; |
||
| 36 | if (! class_exists($type)) return false; |
||
| 37 | $model = resolve($type)->find($values[ 1 ]); |
||
| 38 | if (empty($model) |
||
| 39 | || ! $model instanceof TicketReference |
||
| 40 | || ! $model->hasReferenceAccess()) { |
||
| 41 | return false; |
||
| 42 | } |
||
| 43 | return true; |
||
| 44 | } |
||
| 45 | |||
| 56 |