Hitesh Makwana
Help me to select address from address list in modal
I have created
in this Created an action
my view blade file
Created Table widget with
Please Help me to use record to address form
class AddressForm extends Field
class AddressForm extends Field
Forms\Components\TextInput::make("name")
->label("Name / Company Name")
->maxLength(50)
->suffixAction(
Action::make('select_address')
->icon('heroicon-o-magnifying-glass')
->action(function (callable $get) {
$customer_id = $get('../customer_id');
if (!$customer_id) {
Notification::make()
->danger()
->title('Please select customer First')
->send();
return;
}
})
->modalContent(function (callable $get) {
$customer_id = $get('../customer_id');
return view('filament.addresses.view', compact('customer_id'));
})
->modalSubmitAction(false)
->modalWidth('7xl')
)->inlineSuffix(),
Forms\Components\TextInput::make("name")
->label("Name / Company Name")
->maxLength(50)
->suffixAction(
Action::make('select_address')
->icon('heroicon-o-magnifying-glass')
->action(function (callable $get) {
$customer_id = $get('../customer_id');
if (!$customer_id) {
Notification::make()
->danger()
->title('Please select customer First')
->send();
return;
}
})
->modalContent(function (callable $get) {
$customer_id = $get('../customer_id');
return view('filament.addresses.view', compact('customer_id'));
})
->modalSubmitAction(false)
->modalWidth('7xl')
)->inlineSuffix(),
@php
$widgetData = [
'inModal' => true,
'customer_id' => $customer_id,
];
@endphp
<x-filament-widgets::widgets :widgets="[\App\Filament\Widgets\AddressListWidget::class]" :columns="1" :data="$widgetData" />
@php
$widgetData = [
'inModal' => true,
'customer_id' => $customer_id,
];
@endphp
<x-filament-widgets::widgets :widgets="[\App\Filament\Widgets\AddressListWidget::class]" :columns="1" :data="$widgetData" />
protected function getTableActions(): array
{
return [
Tables\Actions\Action::make('select')
->label('Select')
->action(function ($record) {
$this->emit('addressSelected', $record);
})
->icon('heroicon-o-check'),
];
}
protected function getTableActions(): array
{
return [
Tables\Actions\Action::make('select')
->label('Select')
->action(function ($record) {
$this->emit('addressSelected', $record);
})
->icon('heroicon-o-check'),
];
}
7 replies