This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

ivan_g
ivan_g

I have a $belongsTo definition in a model used for a dropdown relation field. I know that is possible to configure for example order, condition and scope... but how can I query without global scope?

public  $belongsTo = [
        'all_news' => [
            'MyCustomPlugin\Models\News',
            'order' => 'title_en',
            'conditions' => 'type = "news"',
            'scope' => ?? without global-scope ??
        ]
]

In a normal eloquent query I can write something like: News::withoutGlobalScopes()->... but in a relationship used via Builder, is this possible?

thanks

Last updated

ivan_g
ivan_g

ok I found a partial solution, changing the definition of the relation in something like this:

public  $belongsTo = [
        'all_news' => News::class
]

and weel, this works and I get the news without global scope... but now, how can for example to add order or conditions?

Last updated

1-2 of 2

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.