protected function getFormActions(): array { return [ CreateAction::make('create') ->label(__('Request')) ->submit('create') ->hidden(HasAvailableLeaves::hideIfNoAvailableLeaves()) ]; }' I want this code to disappear according to the trait that I have created, but in a code condition like this I get an error An attempt was made to evaluate a closure for [Filament\Actions\CreateAction], but [$get] was unresolvable.
Code in trait 'public static function hideIfNoAvailableLeaves(): Closure { return function ($get) { $userId = $get('user_id');