Access Relationship Input in mutateFormDataBeforeCreate()
Hello, I want to access the relationship inputs in the
mutateFormDataBeforeCreate()
method, but I can only access the non-relationship inputs. How to do that?
3 Replies
Solution
Try
dd($this->data)
, see if the input you want is thereprotected function mutateFormDataBeforeCreate(array $data): array
{
$data['cashier_id'] = auth()->user()->id;
return $data;
}
Maybe like this?Sorry for the late response.
$this->data
does return all the request data. Thank you so much.