You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When defining composite primary keys then calling save or delete on an instanced model, an exception is thrown.
Save
Type:ErrorException Message:PDO::lastInsertId() expects parameter 1 to be string, array given File:/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/Processor.php Line: 32
Delete
Type:ErrorException Message:array_key_exists(): The first argument should be either a string or an integer File:/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php Line: 2324
I suspect Eloquent is expecting a string primary key, while an array is given.
The text was updated successfully, but these errors were encountered:
lazlo-bonin
changed the title
Eloquent cannot delete models with composite primary keys
Eloquent cannot save or delete models with composite primary keys
Jul 28, 2014
When defining composite primary keys then calling save or delete on an instanced model, an exception is thrown.
Save
Type:
ErrorException
Message:
PDO::lastInsertId() expects parameter 1 to be string, array given
File:
/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/Processor.php
Line: 32
Delete
Type:
ErrorException
Message:
array_key_exists(): The first argument should be either a string or an integer
File:
/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php
Line: 2324
I suspect Eloquent is expecting a string primary key, while an array is given.
The text was updated successfully, but these errors were encountered: