Laravel Spatie查询生成器

In the index of my user controller I have the following:

return QueryBuilder::for(User::class)
    ->with('phoneNumbers')
    ->allowedIncludes('trashed')
    ->get();

I was hoping to pass an include param like this:

http://127.0.0.1:8000/v1/users?include=trashed

To append the withTrashed() global scope to the query.

Is this possible? I am most likely missing something obvious, I have tried a few variations in my testing usually ending up with an error like:

"message": "Call to a member function addEagerConstraints() on boolean",
    "exception": "Symfony\\Component\\Debug\\Exception\\FatalThrowableError",
    "file": "/Users/timwickstrom/Sites/Wavefire/api/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php",
    "line": 522,

For reference: https://github.com/spatie/laravel-query-builderenter link description here

After checking out that library, here's what I've got.

return QueryBuilder::for(User::class)
    ->with('phoneNumbers') // <-- I think you can use `allowedIncludes` here.
    ->allowedFilters([ // <-- I believe that `withTrashed` is a scope query,
                       // so you can use this. You cannot use `allowedIncludes`
                       // because it works with relations.
        Filter::scope('withTrashed')
    ])
    ->get();