14 Replies
$livewire->ownerRecord is giving me the parent component entire data. I want simply the current record in the recordmanager
$this->record?
can't use $this in a static function
@toeknee
$livewire->record ?
@toeknee gave me that the property doesn't exist
Anyone ?:(
what are you trying to do, it doesn't make sense to use the record id in the form definition?
Depending where you need it 🙂
Inside some function, you can use $this->record
Inside table() : (you can check for form, should have something similar)
Inside form(), you can also use a function 🙂
Just need to found the object that can provide the record 🙂 (Livewire ? Component ? etc ..)
@awcodes Thank you for your answer.
I have an OrdersResource. Inside orders resource I have a RelationManager table containing the OrderItems.
When the user clicks on an Order Item the form opens. Inside the form I want to have a table, using ViewField containing all the Quotes that can fulfill that OrderItem with an action button that awards that order to that quote.
I need it in the form inside a RelationManager.
ownerRecord gives me the data of the parent not the relation manager record
On all OrderLines, you created a custom action to open the creation form ?
@awcodes Thank you. I'm using v2 and I managed to get it inside the view through the only place I managed to get it is inside the ViewField component using
but I was hoping I can get it in my RelationManager to query a model and pass the results to the view
could try
$form->getRecord()
. not sure if that was in v2 or not. Still feels like you're doing something the wrong way here. But i'm not totally sure.Just tested. I added a createAction on my User model -> relation to teams (belongsToMany).
On my form, I have access to the model & the pivot
Then, I know the record & the line selected. If id is needed, add it on the withPivot
Thank you i'll check those answers
hi! Is $table->getLivewire() in v2? it's not working for me
Thanks everyone! I ended up rethinking how i'm doing it and opting for a different architecture