F
Filament5mo ago
Gush

visible on select

i had a toggle form for this visable but now i want to do it with a select so that if id 2 or 3 of the related table is selected the tab is visible, i appreciate any help
Tabs\Tab::make(__('nlmn-customer-module::customer.customer_resource.company_details'))
->icon('heroicon-m-building-office-2')
->schema([
Select::make('company_entity_type')
->label(__('nlmn-customer-module::customer.customer_resource.entity_type'))
->relationship('customer_type', 'name')
->native(false)
->live()
->required(),
TextInput::make('company_cae')
->label('CAE'),
Select::make('company_sector_activity_id')
->label(__('nlmn-customer-module::customer.customer_resource.activity_sector'))
->preload()
->searchable()
->native(false)
->relationship('sector_activities', 'name'),
TextInput::make('company_employee_count')
->label(__('nlmn-customer-module::customer.customer_resource.employee_count'))
->numeric(),
TextInput::make('company_foundation_year')
->label(__('nlmn-customer-module::customer.customer_resource.foundation_year'))
->numeric()
->placeholder('2023'),
])->columns(2)->visible(fn (Get $get): bool => $get('is_company')),
Tabs\Tab::make(__('nlmn-customer-module::customer.customer_resource.company_details'))
->icon('heroicon-m-building-office-2')
->schema([
Select::make('company_entity_type')
->label(__('nlmn-customer-module::customer.customer_resource.entity_type'))
->relationship('customer_type', 'name')
->native(false)
->live()
->required(),
TextInput::make('company_cae')
->label('CAE'),
Select::make('company_sector_activity_id')
->label(__('nlmn-customer-module::customer.customer_resource.activity_sector'))
->preload()
->searchable()
->native(false)
->relationship('sector_activities', 'name'),
TextInput::make('company_employee_count')
->label(__('nlmn-customer-module::customer.customer_resource.employee_count'))
->numeric(),
TextInput::make('company_foundation_year')
->label(__('nlmn-customer-module::customer.customer_resource.foundation_year'))
->numeric()
->placeholder('2023'),
])->columns(2)->visible(fn (Get $get): bool => $get('is_company')),
0 Replies
No replies yetBe the first to reply to this messageJoin