| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | <?php |
||
| 40 | public function findByUrl(string $url) |
||
| 41 | { |
||
| 42 | $model = static::MODEL; |
||
| 43 | |||
| 44 | if (! isset((new $model)->translatedAttributes)) { |
||
| 45 | return $this->query()->online()->where('url', $url)->first(); |
||
| 46 | } |
||
| 47 | |||
| 48 | return $this->query() |
||
| 49 | ->online() |
||
| 50 | ->whereTranslation('url', $url, content_locale()) |
||
| 51 | ->first(); |
||
| 52 | } |
||
| 53 | |||
| 56 |