'#FFBE86', 'sharing' => 'embed', ]; public static function getNavigationGroup(): ?string { return __( 'translations.settings' ); } public static function getNavigationLabel(): string { return __( 'translations.booking_widget' ); } public function getMaxContentWidth(): MaxWidth { return MaxWidth::ScreenTwoExtraLarge; } public function getTitle(): string|Htmlable { return __( 'translations.booking_widget' ); } public function mount(): void { $this->company = Auth::user()->company; $this->data = $this->company->booking_widget_settings ?: $this->default_data; } public function form( Form $form ): Form { return $form ->live() ->columns( 3 ) ->schema( [ Grid::make( 1 ) ->columnSpan( 1 ) ->schema( [ ColorPicker::make( 'background_color' ) ->label( __( 'translations.background_color' ) ), Radio::make( 'sharing' ) ->label( __( 'translations.sharing' ) ) ->options( [ 'link' => __( 'translations.share_as_link' ), 'embed' => __( 'translations.embed_on_website' ), ] ), Placeholder::make( 'booking_link' ) ->label( __( 'translations.your_booking_link' ) ) ->visible( static fn( Get $get ) => $get( 'sharing' ) === 'link' ) ->content( new HtmlString( '' . $this->company->getOnlineBookingLink() . '' ) ), ] ), Grid::make( 2 ) ->columns( 1 ) ->columnSpan( 2 ) ->schema( [ ViewField::make( 'preview' ) ->hiddenLabel() ->view( 'livewire.booking-widget' ), ] ) ] ) ->statePath( 'data' ); } protected function getFormActions(): array { return [ $this->getSaveFormAction(), ]; } protected function getSaveFormAction(): Action { return Action::make( 'save' ) ->label( __( 'translations.save' ) ) ->submit( 'save' ) ->keyBindings( [ 'mod+s' ] ); } public function save() { $this->company->booking_widget_settings = $this->data; $this->company->save(); Notification::make() ->success() ->title( __( 'translations.saved' ) ) ->send(); } }