cloudcreativity / laravel-json-api

JSON API (jsonapi.org) package for Laravel applications.
http://laravel-json-api.readthedocs.io/en/latest/
Apache License 2.0
780 stars 109 forks source link

SoftDelete #394

Closed rekrios closed 5 years ago

rekrios commented 5 years ago

Hello. I think you can get error here, isn't it ? https://github.com/cloudcreativity/laravel-json-api/blame/v1.3.0/src/Eloquent/Concerns/SoftDeletesModels.php#L153 Something like Call to undefined method ........::getDeletedAtColumn() Maybe you should make checking for trait or something else... isset(class_uses($model)[\Illuminate\Database\Eloquent\SoftDeletes::class])

lindyhopchris commented 5 years ago

I don't think that's necessary as use of the SoftDeletesModels is completely optional... i.e. you shouldn't be adding it to an adapter for a model that cant be soft deleted.

lindyhopchris commented 5 years ago

Just like you only add the Eloquent SoftDeletes trait to the models that actually have a soft delete column

rekrios commented 5 years ago

Thanks. Forgot it's optional)

lindyhopchris commented 5 years ago

No problem!