Custom form component. But i want it to show a model.

I have a custom component. I want to show a button on my form. A button that shows a modal. I couldnt find anything related to this so i thought i could ask for some help or advice.
image.png
image.png
Solution
yes.. create a livewire component called CreateDealer

<!-- resources/views/livewire/create-dealer.blade.php -->
<div>
    <x-filament::modal id="createDealer">
        <x-slot name="heading">
            Create Dealer
        </x-slot>

        <div>
            Content...
        </div>

        <x-slot name="footer">
            <x-filament::button type="button" @click="$dispatch('close-modal', {id: 'createDealer'})">Close</x-filament::button>
        </x-slot>
    </x-filament::modal>

    <x-filament::button type="button" @click="$dispatch('open-modal', {id: 'createDealer'})">Open Modal</x-filament::button>
</div>


Use View to render the component

Grid::make(2)->schema([
    Forms\Components\View::make('livewire.create-dealer'),
])
Was this page helpful?