0
添加範圍到工具欄搜索按文件我有以下代碼:在<a href="https://octobercms.com/docs/backend/lists#adding-toolbar" rel="nofollow noreferrer">https://octobercms.com/docs/backend/lists#adding-toolbar</a>十月
config_list.yaml
toolbar:
buttons: list_toolbar
search:
prompt: 'backend::lang.list.search_prompt'
scope: byEmail
Job.php(模型)
public function scopeByEmail($string, $query)
{
return $query->where('email', 'LIKE', '%' . $string . '%');
}
不幸的是,這產生了一個錯誤:Call to undefined method October\Rain\Database\QueryBuilder::byEmail()
我不明白爲什麼會出現這個錯誤,因爲我確定我在模型中有正確的代碼來處理這個問題。