laravel-json-api / eloquent

Serialize Eloquent models to JSON API resources
MIT License
12 stars 15 forks source link

column method from ID class should have guessColumn as backup #3

Closed martianatwork closed 3 years ago

lindyhopchris commented 3 years ago

The ID class does not have access to the model, so it can't guess the column for the id. As the guess is to use $model->getRouteKeyName().

If you need to know the column name, the public Schema::idKeyName() method can be used.