Import Action - "unknown column '' in `where clause` "
Hello - I am trying to get this importer to behave... I am using it to import records into a Relationship Pivot Table.
The relationship is a belongsToMany relationship - and knowing that it will not play nice on that end, I have made up a Pivot Model to interact with. Here is the pivot model:
To go along with the pivot model - I ahve made up the Importer, as follows: The problem I am having is - the importer is throwing an error as follows: But the "warehouse_id" is 100% being set in the firstOrNew method... Thoughts?
3 Replies
Additionally - I have checked to ensure the warehouse_id is being set via
dd($this->date['warehouse_id']);
and this returns as expected an integer
of the warehouse as listed in the imported CSV file.
Also - I have tested to see if it works to straight up create "new" entries into the pivot table - this works 100% as expected without error.
The only part that does not seem to work - is for the updating existing rows based on what is in the CSV
Get the same error message when I try to do "update only" as directed in the docs as wellThis was the code I used for the "update only" attempt: - Still throws the same error of cannot find the column ''. Here is afull stack trace error ouput - not sure if it will help or not (attached)
Managed to get it to work - had to add a
id
column to the pivot table that increments. Not sure if this is intended behavior or not but seems to work fine now.