© 2026 Hedgehog Software, LLC
Action::make('newPromo') ->button() ->label('Add Promo') ->color('primary') ->mountUsing(fn (ComponentContainer $form) => $form->fill([ 'affiliate_id' => $this->affiliate->id, ])) ->action(function ($data) { $data = array_merge($data,['event_id' => $this->eventId]); $eventPromo = EventPromo::query()->create($data); $this->notify('success', $eventPromo->name.' Promo Created'); return redirect()->to(EventsResource::getUrl('promos',['record' => $this->eventId])); }) ->form($this->promoForm()) ->modalHeading('Add Promo') ->modalActions([ ModalButtonAction::make('create') ->label('Create') ->submit('callMountedAction') ->color('primary'), ModalButtonAction::make('cancel') ->label('Cancel') ->cancel() ->color('secondary'), ]) // ->extraAttributes(['isOpen' => true])
Action::make('newPromo') ->extraAttributes(['wire:init' => new HtmlString('mountTableAction(\'newPromo\')')])