Modal window does not create a map.

Hello! I have encountered a problem that the form in my modal window does not create a map. Livewire/show-user-cards.blade.php: <div> <div class="py-5"> <form wire:submit.prevent="create"> {{ $this->form }} </form> </div> {{$this->table}} </div> Filament/pages/show-user-cards.balde.php: <x-filament-panels::page> <livewire:show-user-cards :user-id="$userId"/> </x-filament-panels::page> Filament/Pages/ShowUserCards.php: <?php namespace App\Filament\Pages; use Filament\Pages\Page; class ShowUserCards extends Page { protected static ?string $navigationIcon = 'heroicon-o-document-text'; protected static string $view = 'filament.pages.show-user-cards'; protected static bool $shouldRegisterNavigation = false; } If you need additional pin information, I will provide it immediately! Thanks in advance ❤️
Solution:
Seems like a complicated approach. just make the card button an action that loads a ->form() and users ->model() fillForm() and uses a repeater? ```php \Filament\Tables\Actions\Action::make('account_records') ->label(' ')...
Jump to solution
7 Replies
Illizian
Illizian4w ago
What's the problem? What do you mean it doesn't create a map?
hxnnxs
hxnnxsOP4w ago
In the video I showed that the table shows the user's current cards and they can be deleted, but they cannot be created
Illizian
Illizian4w ago
Sorry, I still don't understand what's wrong 🙏
hxnnxs
hxnnxsOP4w ago
The thing is that when you click the send button, a record with the card number and user_id is not created in the cards table, although it should be
Solution
toeknee
toeknee3w ago
Seems like a complicated approach. just make the card button an action that loads a ->form() and users ->model() fillForm() and uses a repeater?
\Filament\Tables\Actions\Action::make('account_records')
->label(' ')
->hiddenLabel()
->modalHeading(fn ($record) => 'Editing Details For: '.$record->first_name.' '.$record->last_name)
->model(fn ($record) => $record->accounts)
->fillForm(fn ($record) => ['accounts' => $record->accounts->toArray()])
->form([
Repeater::make('accounts')
->relationship('accounts')
->defaultItems(1)
->schema(
TextInput::make('card_number')
)
->columnSpanFull()
->columns(2)
->addActionLabel('Add Account')
->label(fn ($record) => 'Accounts'),
])
->slideOver()
->action(function ($record, $data) {
Notification::make()
->title('Details Updated Successfully')
->icon('heroicon-o-document-text')
->iconColor('success')
->send()
->sendToDatabase(auth()->user());
})
->icon('heroicon-o-building-library')
->color(fn ($record) => $record->accounts_count ? 'primary' : 'danger'),
\Filament\Tables\Actions\Action::make('account_records')
->label(' ')
->hiddenLabel()
->modalHeading(fn ($record) => 'Editing Details For: '.$record->first_name.' '.$record->last_name)
->model(fn ($record) => $record->accounts)
->fillForm(fn ($record) => ['accounts' => $record->accounts->toArray()])
->form([
Repeater::make('accounts')
->relationship('accounts')
->defaultItems(1)
->schema(
TextInput::make('card_number')
)
->columnSpanFull()
->columns(2)
->addActionLabel('Add Account')
->label(fn ($record) => 'Accounts'),
])
->slideOver()
->action(function ($record, $data) {
Notification::make()
->title('Details Updated Successfully')
->icon('heroicon-o-document-text')
->iconColor('success')
->send()
->sendToDatabase(auth()->user());
})
->icon('heroicon-o-building-library')
->color(fn ($record) => $record->accounts_count ? 'primary' : 'danger'),
hxnnxs
hxnnxsOP3w ago
According to the technical specifications, I need a table with existing maps.
hxnnxs
hxnnxsOP3w ago
I read a lot of documentation and reworked the code similar to the code from the documentation, but it still does not create. I attached the updated code, I also attached a new video with debugbar I really need your help ❤️

Did you find this page helpful?