We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0182615 commit 78530aeCopy full SHA for 78530ae
app/Http/Traits/UniqueSerialTrait.php
@@ -13,11 +13,10 @@ trait UniqueSerialTrait
13
*/
14
protected function prepareUniqueSerialRule($parameters, $field)
15
{
16
- $settings = \App\Models\Setting::first();
17
-
18
- if ($settings->unique_serial=='1') {
19
- return 'unique_undeleted:'.$this->table.','. $this->getKey();
+ if ($settings = \App\Models\Setting::first()) {
+ if ($settings->unique_serial=='1') {
+ return 'unique_undeleted:'.$this->table.','. $this->getKey();
+ }
20
}
21
22
23
0 commit comments