Forms\Components\Select::make('platforms')
->options(function () {
return Platform::query()
->get()
->mapWithKeys(fn ($platform) => [$platform->id => $platform->name]);
})
->label(__('Platforms'))
->default(function () {
return ChannelPlatformFrequency::query()
->where('channel_id', request()->route('record'))
->get()
->mapWithKeys(fn ($channelPlatformFrequency) => [$channelPlatformFrequency->platform_id => $channelPlatformFrequency->platform->name]);
})
->multiple()
->required(),
Forms\Components\Select::make('platforms')
->options(function () {
return Platform::query()
->get()
->mapWithKeys(fn ($platform) => [$platform->id => $platform->name]);
})
->label(__('Platforms'))
->default(function () {
return ChannelPlatformFrequency::query()
->where('channel_id', request()->route('record'))
->get()
->mapWithKeys(fn ($channelPlatformFrequency) => [$channelPlatformFrequency->platform_id => $channelPlatformFrequency->platform->name]);
})
->multiple()
->required(),