Skip to content

Commit 78530ae

Browse files
committed
Fix tests
1 parent 0182615 commit 78530ae

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

app/Http/Traits/UniqueSerialTrait.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@ trait UniqueSerialTrait
1313
*/
1414
protected function prepareUniqueSerialRule($parameters, $field)
1515
{
16-
$settings = \App\Models\Setting::first();
17-
18-
if ($settings->unique_serial=='1') {
19-
return 'unique_undeleted:'.$this->table.','. $this->getKey();
16+
if ($settings = \App\Models\Setting::first()) {
17+
if ($settings->unique_serial=='1') {
18+
return 'unique_undeleted:'.$this->table.','. $this->getKey();
19+
}
2020
}
21-
2221
}
2322
}

0 commit comments

Comments
 (0)