Add preview button to modal - get record
I want to add a preview button to an edit modal. however im unable to get the record that is being modified.
* im getting error -
Missing required parameter for [Route:
...10 Replies
what is the parameters for the route
notice-preview
Check whether
$record
is available and not null via dd()
. Not sure whether it is. Maybe you need $livewire
and $livewire->getRecord()
or $livewire->record
i did info($record) before returning
i get:
[2023-07-25 11:45:01] local.INFO: []
so the route is fine, is the record that is empty
from where do i can get the variable $livewire?
i pass it to the anonymous fn, next to the record?
yes
https://filamentphp.com/docs/2.x/admin/resources/relation-managers#accessing-the-owner-record
as an example of usage in RelationManager
Filament
Relation managers - Resources - Admin Panel - Filament
The elegant TALL stack admin panel for Laravel artisans.
RelationManager doesnt exist
im not using admin panel
This is showing an example of the use of livewire.
but i need to use the RelationManager class, dont i?
if so, i cant import it
use Filament\Resources\RelationManagers\RelationManager;
otherwise i dont understand what i have to doNo you define the class in use so which is a livewire component. ReltionManager is a livewire component which explains how $livewire can be used in that scenario. Deep dive on the vendor code you'll understand it better.
okay, thanks hmm