Back

When I have nested parameters in an url using route model binding, laravel will automatically populate the pivot on the child model. This even works on belongToMany relationships, with a custom pivot model. Sadly this breaks in livewire when rehydrating the child model.

Does anyone have a clever trick to hydrate the pivot again ?

3

128

In response to @sinnbeck

This is how I do it currently, but it seems kinda hacky :)

    public function hydrateFile()
{
$this->file = $this->customer->resolveChildRouteBinding('file', $this->file->uuid, 'uuid');
}

134

  • No matching results...
  • Searching...

/ 1000