瀏覽代碼

Update CustomFilterKeyword model, add setKeywordAttribute method

Daniel Supernault 3 月之前
父節點
當前提交
578718c606
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      app/Models/CustomFilterKeyword.php

+ 5 - 0
app/Models/CustomFilterKeyword.php

@@ -19,6 +19,11 @@ class CustomFilterKeyword extends Model
         return $this->belongsTo(CustomFilter::class);
     }
 
+    public function setKeywordAttribute($value)
+    {
+        $this->attributes['keyword'] = mb_strtolower(trim($value));
+    }
+
     public function toRegex()
     {
         $pattern = preg_quote($this->keyword, '/');