Conditions | 3 |
Paths | 4 |
Total Lines | 8 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | public function scopeLocale($query, ?string $locale = '', ?string $country = ''): Builder |
||
21 | { |
||
22 | $locale = ! empty($locale) ? $locale : Locale::getAppOrDefaultLocale(); |
||
23 | $country = ! empty($country) ? $country : Locale::getAppOrDefaultCountry(); |
||
24 | |||
25 | return $query |
||
|
|||
26 | ->whereRaw('LOWER(' . $this->getTable() . '.country) LIKE LOWER("' . $country . '")') |
||
27 | ->whereRaw('LOWER(' . $this->getTable() . '.locale) LIKE LOWER("' . $locale . '")'); |
||
28 | } |
||
30 |