Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
54 | protected function isSlugExists(string $slug): bool |
||
55 | { |
||
56 | $key = $this->getKey(); |
||
57 | |||
58 | if ($this->incrementing) { |
||
59 | $key ?? '0'; |
||
60 | } |
||
61 | |||
62 | $query = static::where('slug', $slug) |
||
63 | ->where($this->getKeyName(), '!=', $key) |
||
64 | ->withoutGlobalScopes(); |
||
65 | |||
66 | return $query->exists(); |
||
67 | } |
||
68 | } |