esensi / model

The base model traits of Esensi
MIT License
202 stars 25 forks source link

SoftDelete withTrashed and onlyTrashed throw error for Laravel >= 5.2.36 #30

Closed EngNet closed 8 years ago

EngNet commented 8 years ago

Since upgrading to Laravel 5.2.36 I get the following error.

Class App\User contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods
 (Esensi\Model\Contracts\SoftDeletingModelInterface::withTrashed, 
Esensi\Model\Contracts\SoftDeletingModelInterface::onlyTrashed)

The change log points to this. https://github.com/laravel/framework/pull/13396

I think both withTrashed() and onlyTrashed() were move into macros and are not standalone methods anymore.

If I comment out the interface methods for both withTrashed() and onlyTrashed() everything still seems to work.

dalabarge commented 8 years ago

We only officially support Laravel LTS (5.1) with our packages but it is good to know that this incompatibility with future Laravel 5.2+ installs exists. We went ahead and opened a separate PR and will update there with an all around better fix for both 5.1 and 5.2+. Thanks.