laravel-json-api
laravel-json-api copied to clipboard
Multiple primary keys - Mysql Error
When I have a model with multiple primary keys I get a SQL error.
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as `` asc limit 5 offset 0' at line 1 at /var/www/v2/laravel/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:79)
[stacktrace]
The package expects models to have a single primary key. You'd need to implement this yourself, as there isn't really a good generic way for the package to know how to handle multiple primary keys. That's because the JSON:API spec defines a single id field for the key of a resource - so knowing how to map that single id value to multiple primary keys isn't really something this package can do.