06.10.2016 Views

laravel-5

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Upgrade Guide 49<br />

Soft Deleting Models Now Use Traits<br />

If you are using soft deleting models, the softDeletes property has been removed. You must now<br />

use the SoftDeletingTrait like so:<br />

1 use Illuminate\Database\Eloquent\SoftDeletingTrait;<br />

2<br />

3 class User extends Eloquent<br />

4 {<br />

5 use SoftDeletingTrait;<br />

6 }<br />

You must also manually add the deleted_at column to your dates property:<br />

1 class User extends Eloquent<br />

2 {<br />

3 use SoftDeletingTrait;<br />

4<br />

5 protected $dates = ['deleted_at'];<br />

6 }<br />

The API for all soft delete operations remains the same.<br />

Note: The SoftDeletingTrait can not be applied on a base model. It must be used on an<br />

actual model class.<br />

View / Pagination Environment Renamed<br />

If you are directly referencing the Illuminate\View\Environment class or Illuminate\Pagination\Environment<br />

class, update your code to reference Illuminate\View\Factory and Illuminate\Pagination\Factory<br />

instead. These two classes have been renamed to better reflect their function.<br />

Additional Parameter On Pagination Presenter<br />

If you are extending the Illuminate\Pagination\Presenter class, the abstract method get-<br />

PageLinkWrapper signature has changed to add the rel argument:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!