As per the documentation at https://octobercms.com/docs/backend/lists#adding-toolbar I have the following code:
config_list.yaml
toolbar:
buttons: list_toolbar
search:
prompt: 'backend::lang.list.search_prompt'
scope: byEmail
Job.php (model)
public function scopeByEmail($string, $query)
{
return $query->where('email', 'LIKE', '%' . $string . '%');
}
Unfortuately, this produces an error: Call to undefined method October\Rain\Database\QueryBuilder::byEmail()
I don't understand why this error occurs, because I'm sure that I have the correct code in the model to deal with this.