BelongsToFilter

You're browsing the documentation for an old version of MoonShine. Consider upgrading your project to MoonShine 2.x.

Extends BelongsTo * has the same features
use MoonShine\Filters\BelongsToFilter;
 
//...
 
public function filters(): array
{
return [
BelongsToFilter::make('Author', resource: 'name')
->nullable()
->canSee(fn() => auth('moonshine')->user()->moonshine_user_role_id === 1),
];
}
 
//...