Victor Hugo Alves
Victor Hugo Alves
FFilament
Created by Victor Hugo Alves on 10/24/2023 in #❓┊help
Inject Model in Livewire Component
I have the property, first line of my example. I tried manually, but same problem. I "fixed" passing the record as a parameter in the livewire component.
public $campaign;

public function mount($campaign)
{
$this->campaign = $campaign;
$this->form->fill();
}
public $campaign;

public function mount($campaign)
{
$this->campaign = $campaign;
$this->form->fill();
}
<x-filament-panels::page>
<x-filament-panels::form wire:submit="save">
{{ $this->form }}

<x-filament-panels::form.actions :actions="$this->getCachedFormActions()" :full-width="$this->hasFullWidthFormActions()" />
</x-filament-panels::form>

@if (count($relationManagers = $this->getRelationManagers()))
<x-filament-panels::resources.relation-managers :active-manager="$activeRelationManager" :managers="$relationManagers" :owner-record="$record"
:page-class="static::class" />
@endif
<x-filament::section>
<x-slot name="heading">
Upload de mailing
</x-slot>
<livewire:upload-mailing :campaign="$record" />
</x-filament::section>
</x-filament-panels::page>
<x-filament-panels::page>
<x-filament-panels::form wire:submit="save">
{{ $this->form }}

<x-filament-panels::form.actions :actions="$this->getCachedFormActions()" :full-width="$this->hasFullWidthFormActions()" />
</x-filament-panels::form>

@if (count($relationManagers = $this->getRelationManagers()))
<x-filament-panels::resources.relation-managers :active-manager="$activeRelationManager" :managers="$relationManagers" :owner-record="$record"
:page-class="static::class" />
@endif
<x-filament::section>
<x-slot name="heading">
Upload de mailing
</x-slot>
<livewire:upload-mailing :campaign="$record" />
</x-filament::section>
</x-filament-panels::page>
5 replies