my widget is hidden if I select date range.
I have this kind of condition in can view the reason is on dashboard only MerchanAdmin can see the widget but on the page both SuperAdmin,Admin and Merchant Admin can view the widget
public static function canView(): bool
{
$user = auth()->user();
if(request()->routeIs('filament.admin.pages.dashboard')){
return $user->role === Role::MerchantAdmin;
}elseif(request()->routeIs('filament.admin.pages.store-performance')){
return in_array($user->role, [
Role::SuperAdmin,
Role::Admin,
Role::MerchantAdmin,
]);
}
return false;
}
any thoughts how to solve?
0 Replies