Open cris-alteregoweb opened 2 years ago
It would be nice to be able to access the translations in the condition of the updateOrCreate method just like when using it when doing insert. Something like that:
Model::updateOrCreate([ 'model_id' => $model->id, 'es' => [ 'section' => 'Ejemplo', 'title' => 'Ejemplo documento ', 'doc' => 'documento.pdf', ], ], [ 'model_id' => $model->id, 'es' => [ 'section' => 'Ejemplo', 'title' => 'Ejemplo documento', 'doc' => 'documento_es.pdf', ], 'en' => [ 'section' => 'Example', 'title' => 'Example document', 'doc' => 'document_en.pdf', ], ]);
I find myself in this problem and I thought it was a good idea to propose it.
It would be nice to be able to access the translations in the condition of the updateOrCreate method just like when using it when doing insert. Something like that:
Model::updateOrCreate([ 'model_id' => $model->id, 'es' => [ 'section' => 'Ejemplo', 'title' => 'Ejemplo documento ', 'doc' => 'documento.pdf', ], ], [ 'model_id' => $model->id, 'es' => [ 'section' => 'Ejemplo', 'title' => 'Ejemplo documento', 'doc' => 'documento_es.pdf', ], 'en' => [ 'section' => 'Example', 'title' => 'Example document', 'doc' => 'document_en.pdf', ], ]);
I find myself in this problem and I thought it was a good idea to propose it.