Skip to content
This repository has been archived by the owner on Aug 17, 2021. It is now read-only.

Compatibility issues with updateOrCreate #14

Open
SuryaWebfox opened this issue Apr 10, 2020 · 0 comments
Open

Compatibility issues with updateOrCreate #14

SuryaWebfox opened this issue Apr 10, 2020 · 0 comments

Comments

@SuryaWebfox
Copy link

SuryaWebfox commented Apr 10, 2020

$language = Language::updateOrCreate([
    'id' => $values[1],`
    'name' => $values[2],`
    'parent_id' => $values[3],
]);

cause the following error:

SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'id' in where clause is ambiguous (SQL: select 'languages'.*, 'language_translations'.'name' from 'languages' left join 'language_translations' on 'languages'.'id' = 'language_translations'.'language_id' and 'locale' = nl where ('id' = 1 and 'parent_id' = 0) limit 1)

If there is no easy fix for this, is there an other way to use updateOrCreate?

Update: even simple things like Language::whereId(1)->get(); cause the same issue

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant