October CMS filter scopes options

To add scope options from your database table you need to provide modalClass details and its options method

Here you can see getCategoryTypesAttribute method will return all the opetions of scope which is defined in the Category modal.

scopes:
    category_type:
        label: Food Type
        type: group
        conditions: type in (:filtered)
        options: getCategoryTypesAttribute
        modelClass: Acme\Blog\Models\Category

Category modal => getCategoryTypesAttribute method

public function getCategoryTypesAttribute(){
    return [
        1 => 'food',
        2 => 'beverages'
    ];
}
js interview questions