Laravel livewire exception: Queueing collections with multiple model connections is not supported

I´m beggining my Livewire journey and have created a list component which contains a form component for each of the list elements, and as I am trying to make it all work I keep getting the following never before seen exception:

LogicException Queueing collections with multiple model connections is not supported.

I use the same single connection for every model in my project, and I am not queueing anything on purpose in any of the components I’m currently working on, so I have no clue as to where to start debugging this exception. The error message doesn´t help much either. In fact, I don´t even know what to post here for you guys to help me, short of posting the whole project… Also, oddly enough, this errors happens only on ocassions, most of the time everything works fine without any changes to the code, so I´m trying to hit a moving target.

I guess I´m just angling for any clue as to where to start looking to get this fixed, so any help is much appreciated.

Here´s the Network Headers Section response:

  1. Request URL:

duki.local/livewire/message/traducciones-lista

  1. Request Method:

POST

  1. Status Code:

500 Internal Server Error

  1. Remote Address:

127.0.0.1:80

  1. Referrer Policy:

strict-origin-when-cross-origin

  1. Response Headersview source

  2. Cache-Control:

no-cache, private

  1. Connection:

close

  1. Content-Type:

text/html; charset=UTF-8

  1. Date:

Tue, 06 Apr 2021 00:16:36 GMT

  1. Server:

Apache/2.4.46 (Win64) PHP/7.3.21

  1. Set-Cookie:

XSRF-TOKEN=eyJpdiI6IlR3WjFQS1pSUUNnTVRwTDl0SFBWYWc9PSIsInZhbHVlIjoieWdReENjU1hUbG9vYXh3ZEtkeVZ6RFhIcUo3amltUkYyYmM5YTROSmprZGJPZThlSkFIUU5DUE5aaFF3amVxeEhxREcyTFByWG9FN0M2NzJqcXdoMGVjUUN6WEV5cVRPZ1JaWFVpNzc2cytMYU1vVGl0V1lYbkFtemF0Tk9BRVkiLCJtYWMiOiIwOTI2MzQ4NGYwYzEwMWUzOTJhOTE1YWE4OTZmMWM1NGQ5ZmMyMjA0YWU3NWFiMTE4OWJjNjY1OWE5OTQ3OWIwIn0%3D; expires=Tue, 06-Apr-2021 02:16:36 GMT; Max-Age=7200; path=/; samesite=lax

  1. Set-Cookie:

duki_shop_donde_compras_y_vendes_de_volada_session=eyJpdiI6ImZOMnI0aGhVdUExZ2wyNjcvM2NsYXc9PSIsInZhbHVlIjoieTRkcndDS0k1d04zNmdNT2VGYkVIMGdwajF3VU1XUnI5a1FKblM2WGJyTlRGMU43U1BDVUtuOHJIV2ZZU2NzMFZ2WVl4UTJDeDhTZzJ5WDNDNE1YbUN4K3pvejBnbFhyOUxDeFBmVW1FNkNzNTlycXBKUjNVT2hSSDhGWWlrK3IiLCJtYWMiOiI2YThiNGViZGU2NzBlZTdiNDI5ZWU2YWFiYzRhYTIyZTI4ZGVjYjIzMThhZTMwMDgxOTNiZDRiNzUyYmRmMzQ3In0%3D; expires=Tue, 06-Apr-2021 02:16:36 GMT; Max-Age=7200; path=/; httponly; samesite=lax

  1. Transfer-Encoding:

chunked

  1. X-Powered-By:

PHP/7.3.21

  1. Request Headersview source

  2. Accept:

text/html, application/xhtml+xml

  1. Accept-Encoding:

gzip, deflate

  1. Accept-Language:

es-ES,es;q=0.9,en;q=0.8,la;q=0.7

  1. Cache-Control:

no-cache

  1. Connection:

keep-alive

  1. Content-Length:

917

  1. Content-Type:

application/json

  1. Cookie:

_ga=GA1.1.631031515.1614986548; usercookie_id=eyJpdiI6InRQdUUyWVNLcHVweHgyVy90eDZVZFE9PSIsInZhbHVlIjoiYjhRQlM1aU5nTVRWenA4dmdnTTlXWCtHalB1YnRMZ3JBaE1IaEd6eDJyWmt5eGtxZlZMNEFOdks4QzUxM0x2WiIsIm1hYyI6IjNjZDQ1MDhhZDYwMDdmMTEzNDI4ZGFmZWFjNmRmZGIyYzc1MTJmNTNiZDg2ODM0NDZmMjkwM2U4MmE1YzJiMTMifQ%3D%3D; laravel_session=eyJpdiI6IkZwYzFOQUpTMHRtZFdtMkMwMVlUTmc9PSIsInZhbHVlIjoiVTBhdC9TaWEvTURxdDExRk9mSGkyZzRVTEYvYjIwSU1mRmpVMjlJeTAzdFZwV2lSUERnOUM3ZFk5VjV5M1NxeU1laDZoVkQxKzh2OU5UMGZXV3VJNXFIOG5ka2pCMzc2b25XdEJTZE0yZFRzUmUvZnNtT0UraVpQcXdVeUY4UGEiLCJtYWMiOiI3Mzc4NWZkZDIxMDM0MzBmMjEyZmIwNGYwOTZkNjY5ZGNlZGI2NDg1MzIwMzBjNzRiMDE2MjQ0YjgwZWIxNGI2In0%3D; _ga_PXV9VWNBDB=GS1.1.1617667570.85.1.1617668160.0; XSRF-TOKEN=eyJpdiI6IjRHNFhXaFljOGpzWFhSYldGdHJYelE9PSIsInZhbHVlIjoiSHpyTDZVSndaei96aUR1MXVBTUdiajVWcWNheWh5cVNyNzh2V3doS2o4TUdNVWtWeTZYTHdYUE15cisyajBLbmU3YVdJckplVUlQUU9HWkowWFZwN0JoUkhPSXQyT1NSSDJlbTJQUFkyLzV6QXV3YUZCSVhKcm93NG9kQmVDbmciLCJtYWMiOiIzNGI3Mjg1NGNkZjNmYTMxNGI5Mzg1M2MyZjUyNjQ2MGY0NDQ5NDQ4MjQ5MzhjOWVlNmFmODZjMGUzNGYxNzliIn0%3D; duki_shop_donde_compras_y_vendes_de_volada_session=eyJpdiI6InUxcjV0YW50MUZDUDFYa2p2Wk1vOGc9PSIsInZhbHVlIjoiUjJFWG5pc0U4VVNoYjRjdUlUWm5VMWpCcWFQSTc2eERwMXd6QTBnV0hEL0tvWkhWT2xiSyszU1A3ZXlHeENyWk1td0RJYXQwWkNRLzdXRUhqR05HT1pvMUVZZGVWZzkyOW43eVNJM3pmMThrNnJUdzhSbDc2KzMyTjBnQjRDenIiLCJtYWMiOiJjMzZmNjM0MGQ5NzE4NWM0OGMxYjYyZWE3MDgwNzcwNTYwMGM3NjQ0Y2Q0ZTg2NDQ2YWUxODAxODQzMTVlNjI5In0%3D

  1. Host:

duki.local

  1. Origin:

duki.local

  1. Pragma:

no-cache

  1. Referer:

duki.local/textos

  1. User-Agent:

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36

  1. X-CSRF-TOKEN:

gve6MrGnkY8zHYKrajFaNN8l5IaEPiP6yEdkvdaI

  1. X-Livewire:

true

  1. X-Socket-ID:

undefined

  1. Request Payloadview source

  2. {,…}

1. fingerprint: {id: "RLcT5Kgf1G6qstBoa5ZY", name: "traducciones-lista", locale: "es", path: "textos", method: "GET"}

  1. id: "RLcT5Kgf1G6qstBoa5ZY"
  2. locale: "es"
  3. method: "GET"
  4. name: "traducciones-lista"
  5. path: "textos"

2. serverMemo: {children: {"": {id: "Mu2iInCo9H7p1X0RVMgA", tag: "div"}}, errors: [], htmlHash: "46b3ca5c",…}

  1. checksum: "4671d27812b75bba3875c2474ca3b605a0b0d820c384aa80b2bac5bcc9b6a3ea"
  2. children: {"": {id: "Mu2iInCo9H7p1X0RVMgA", tag: "div"}}

    1. "": {id: "Mu2iInCo9H7p1X0RVMgA", tag: "div"}

      1. id: "Mu2iInCo9H7p1X0RVMgA"
      2. tag: "div"

  3. data: {texto: [], idiomas_disponibles: [[], [], []], traduccion_actual: [], traducciones: [[]]}

    1. idiomas_disponibles: [[], [], []]

      1. 0: []
      2. 1: []
      3. 2: []

    2. texto: []
    3. traduccion_actual: []
    4. traducciones: [[]]

      1. 0: []

  4. dataMeta: {,…}

    1. modelCollections: {,…}

      1. idiomas_disponibles: {class: "App\Models\Idioma", id: [1, 2, 3], relations: ["texto", "texto.traducciones"],…}

        1. class: "App\Models\Idioma"
        2. connection: "mysql"
        3. id: [1, 2, 3]

          1. 0: 1
          2. 1: 2
          3. 2: 3

        4. relations: ["texto", "texto.traducciones"]

          1. 0: "texto"
          2. 1: "texto.traducciones"

      2. traducciones: {class: "App\Models\Traduccion", id: [null], relations: ["idioma"], connection: "mysql"}

        1. class: "App\Models\Traduccion"
        2. connection: "mysql"
        3. id: [null]

          1. 0: null

        4. relations: ["idioma"]

          1. 0: "idioma"

    2. models: {texto: {class: "App\Models\Texto", id: 4, relations: ["traducciones"], connection: "mysql"},…}

      1. texto: {class: "App\Models\Texto", id: 4, relations: ["traducciones"], connection: "mysql"}

        1. class: "App\Models\Texto"
        2. connection: "mysql"
        3. id: 4
        4. relations: ["traducciones"]

          1. 0: "traducciones"

      2. traduccion_actual: {class: "App\Models\Traduccion"}

        1. class: "App\Models\Traduccion"

  5. errors: []
  6. htmlHash: "46b3ca5c"

3. updates: [{type: "callMethod", payload: {method: "nuevoRegistro", params: []}}]

  1. 0: {type: "callMethod", payload: {method: "nuevoRegistro", params: []}}

    1. payload: {method: "nuevoRegistro", params: []}

      1. method: "nuevoRegistro"
      2. params: []

    2. type: "callMethod"

Here´s the Network response preview:

LogicException: Queueing collections with multiple model connections is not supported. in file C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Collection.php on line 705

#0 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Collections\Traits\EnumeratesValues.php(234): Illuminate\Database\Eloquent\Collection->Illuminate\Database\Eloquent{closure}(Object(App\Models\Traduccion), 1)
#1 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Collection.php(707): Illuminate\Support\Collection->each(Object(Closure))
#2 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Queue\SerializesAndRestoresModelIdentifiers.php(27): Illuminate\Database\Eloquent\Collection->getQueueableConnection()
#3 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\livewire\livewire\src\HydrationMiddleware\HydratePublicProperties.php(182): Livewire\HydrationMiddleware\HydratePublicProperties->getSerializedPropertyValue(Object(Illuminate\Database\Eloquent\Collection))
#4 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\livewire\livewire\src\HydrationMiddleware\HydratePublicProperties.php(71): Livewire\HydrationMiddleware\HydratePublicProperties::dehydrateModels(Object(Illuminate\Database\Eloquent\Collection), ‘traducciones’, Object(Livewire\Response), Object(App\Http\Livewire\TraduccionesLista))
#5 [internal function]: Livewire\HydrationMiddleware\HydratePublicProperties::Livewire\HydrationMiddleware{closure}(Object(Illuminate\Database\Eloquent\Collection), ‘traducciones’)
#6 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\livewire\livewire\src\HydrationMiddleware\HydratePublicProperties.php(93): array_walk(Array, Object(Closure))
#7 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\livewire\livewire\src\LifecycleManager.php(145): Livewire\HydrationMiddleware\HydratePublicProperties::dehydrate(Object(App\Http\Livewire\TraduccionesLista), Object(Livewire\Response))
#8 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\livewire\livewire\src\Connection\ConnectionHandler.php(14): Livewire\LifecycleManager->dehydrate()
#9 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\livewire\livewire\src\Controllers\HttpConnectionHandler.php(20): Livewire\Connection\ConnectionHandler->handle(Array)
#10 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Routing\ControllerDispatcher.php(48): Livewire\Controllers\HttpConnectionHandler->__invoke(‘traducciones-li…’)
#11 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Routing\Route.php(254): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Livewire\Controllers\HttpConnectionHandler), ‘__invoke’)
#12 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Routing\Route.php(197): Illuminate\Routing\Route->runController()
#13 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Routing\Router.php(693): Illuminate\Routing\Route->run()
#14 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(128): Illuminate\Routing\Router->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))
#15 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Routing\Middleware\SubstituteBindings.php(50): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#16 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(167): Illuminate\Routing\Middleware\SubstituteBindings->handle(Object(Illuminate\Http\Request), Object(Closure))
#17 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\VerifyCsrfToken.php(78): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#18 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(167): Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure))
#19 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\View\Middleware\ShareErrorsFromSession.php(49): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#20 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(167): Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#21 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Session\Middleware\AuthenticateSession.php(58): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#22 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(167): Illuminate\Session\Middleware\AuthenticateSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#23 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Session\Middleware\StartSession.php(121): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#24 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Session\Middleware\StartSession.php(64): Illuminate\Session\Middleware\StartSession->handleStatefulRequest(Object(Illuminate\Http\Request), Object(Illuminate\Session\Store), Object(Closure))
#25 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(167): Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#26 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse.php(37): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#27 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(167): Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure))
#28 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Cookie\Middleware\EncryptCookies.php(67): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#29 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(167): Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure))
#30 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#31 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Routing\Router.php(695): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#32 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Routing\Router.php(670): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#33 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Routing\Router.php(636): Illuminate\Routing\Router->runRoute(Object(Illuminate\Http\Request), Object(Illuminate\Routing\Route))
#34 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Routing\Router.php(625): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#35 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(166): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#36 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(128): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http{closure}(Object(Illuminate\Http\Request))
#37 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\ValidatePostSize.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#38 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(167): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle(Object(Illuminate\Http\Request), Object(Closure))
#39 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance.php(86): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#40 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(167): Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle(Object(Illuminate\Http\Request), Object(Closure))
#41 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\fruitcake\laravel-cors\src\HandleCors.php(37): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#42 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(167): Fruitcake\Cors\HandleCors->handle(Object(Illuminate\Http\Request), Object(Closure))
#43 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\fideloper\proxy\src\TrustProxies.php(57): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#44 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(167): Fideloper\Proxy\TrustProxies->handle(Object(Illuminate\Http\Request), Object(Closure))
#45 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#46 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(141): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#47 C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(110): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#48 C:\Users\bfcba\OneDrive\aplicaciones\duki\public\index.php(52): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#49 {main}

Here’s the console message:

Failed to load resource: the server responded with a status of 500 (Internal Server Error)
livewire.js?id=25f025805c3c370f7e87:13 POST duki.local/livewire/message/traducciones-lista 500 (Internal Server Error)

Here’s the error message Stack trace:

    • C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Collection.php

Illuminate\Database\Eloquent\Collection

:705
2. * 49

C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\laravel\framework\src\Illuminate\Collections\Traits\EnumeratesValues.php

Illuminate\Support\Collection

:234

  • 48

Illuminate\Database\Eloquent\Collection

:707

  • 47

Livewire\HydrationMiddleware\HydratePublicProperties

:27

  • 46

Livewire\HydrationMiddleware\HydratePublicProperties

:182

  • 45

Livewire\HydrationMiddleware\HydratePublicProperties

:71
3. 1 unknown frame

    • 43

C:\Users\bfcba\OneDrive\aplicaciones\duki\vendor\livewire\livewire\src\HydrationMiddleware\HydratePublicProperties.php

Livewire\HydrationMiddleware\HydratePublicProperties

:93

  • 42

Livewire\LifecycleManager

:145

  • 41

Livewire\Connection\ConnectionHandler

:14

  • 40

Livewire\Controllers\HttpConnectionHandler

:20

  • 39

Illuminate\Routing\ControllerDispatcher

:48

  • 38

Illuminate\Routing\Route

:254

  • 37

Illuminate\Routing\Route

:197

  • 36

Illuminate\Routing\Router

:693

  • 35

Illuminate\Pipeline\Pipeline

:128

  • 34

Illuminate\Routing\Middleware\SubstituteBindings

:50

  • 33

Illuminate\Pipeline\Pipeline

:167

  • 32

Illuminate\Foundation\Http\Middleware\VerifyCsrfToken

:78

  • 31

Illuminate\Pipeline\Pipeline

:167

  • 30

Illuminate\View\Middleware\ShareErrorsFromSession

:49

  • 29

Illuminate\Pipeline\Pipeline

:167

  • 28

Illuminate\Session\Middleware\AuthenticateSession

:58

  • 27

Illuminate\Pipeline\Pipeline

:167

  • 26

Illuminate\Session\Middleware\StartSession

:121

  • 25

Illuminate\Session\Middleware\StartSession

:64

  • 24

Illuminate\Pipeline\Pipeline

:167

  • 23

Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse

:37

  • 22

Illuminate\Pipeline\Pipeline

:167

  • 21

Illuminate\Cookie\Middleware\EncryptCookies

:67

  • 20

Illuminate\Pipeline\Pipeline

:167

  • 19

Illuminate\Pipeline\Pipeline

:103

  • 18

Illuminate\Routing\Router

:695

  • 17

Illuminate\Routing\Router

:670

  • 16

Illuminate\Routing\Router

:636

  • 15

Illuminate\Routing\Router

:625

  • 14

Illuminate\Foundation\Http\Kernel

:166

  • 13

Illuminate\Pipeline\Pipeline

:128

  • 12

Illuminate\Foundation\Http\Middleware\ValidatePostSize

:27

  • 11

Illuminate\Pipeline\Pipeline

:167

  • 10

Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance

:86

  • 9

Illuminate\Pipeline\Pipeline

:167

  • 8

Fruitcake\Cors\HandleCors

:37

  • 7

Illuminate\Pipeline\Pipeline

:167

  • 6

Fideloper\Proxy\TrustProxies

:57

  • 5

Illuminate\Pipeline\Pipeline

:167

  • 4

Illuminate\Pipeline\Pipeline

:103

  • 3

Illuminate\Foundation\Http\Kernel

:141

  • 2

Illuminate\Foundation\Http\Kernel

:110

  • 1

:52

I´ll be happy to post all the information that you consider necessary. Just let me know.

I´m using Laravel 8.34.0 and Livewire 2.0

This same question was published on stackoverflow 3 days ago, but didn´t receive any answers or comments.

Thanks in advance.

I see the same problem when adding to an eloquent collection:

$this->members->push(Member::make());

This happens only when I add Member::make() twice to the collection.

Trace:

which calls vendor/laravel/framework/src/Illuminate/Queue/SerializesAndRestoresModelIdentifiers.php:27

$value->getQueueableClass()

which calls:

Reproduce the error here by clicking “add” twice: https://laravelplayground.com/#/snippets/ffba6077-605a-463f-a727-55ac092565ae

I create a github issue: https://github.com/livewire/livewire/issues/2749

This happens because to your collection of Member objects, I assume retrieved via Eloquent from the database, you are adding a new one NOT retrieved from the database. You must therefore declare the mysql connection (or the one used by the first model in the collection) to the new model you want to add.

$member = Member::make()->setConnection('mysql');
$this->members->push($member):

I have the same problem given the scenario you described. However, setting the connection of the new Model to ‘mysql’ or to whatever connection the collection models use still give me this error.

A workaround that I found was to use an array instead of a collection.

$this->members = $club->members->all();
$newMember = Member::make();
$this->members[] = $newMember;