Laravel Digest (December 2013)
Welcome to the fourth instalment of Laravel Digest, the series where I give a regular rundown of important changes, fixes and additions to Laravel’s master branch. Due to the release of Laravel 4.1 I’ve decided to bring this post forward to match the status of Laravel on the day(ish) of release. As such, below are the changes up to the middle of December 2013:
Collection#first
can now have a closure (and default) passed to it that will be passed into aarray_first
-like call (d600ebe
):
1 2 3 4 5 6 7 8 9 |
|
New
array_last
helper (side-effect of some other work which was reverted) that works the same as array_first (88421dd
)Collection#sortBy
now takes sort flags as its second parameter (426c9e0
)You can now retrieve failed recipients to
Mail::send()
withMail::failures()
(a0086a5)Model::destroy()
now returns the number of rows that were deleted (0f1a3cc
)There’s also a bunch of new documentation for all the new features I’ve spoken about:
- Upgrade guide
- New password reminder system
- Cache tags
- Queues had a number of changes, the most important being logging of failed jobs. So its documentation should be looked over.
- A new SSH module was incorporated primarily for interacting with a live environment (for example, deployment or tailing remote logs).
- New Blade features
Validator#sometimes()
documentation- Database read/write connection splitting
- Database query builder got some extra methods as pessimistic locking.
- Eloquent relationships had a few updates too:
- hasManyThrough
- Polymorphic many-to-many() (not yet in official documentation)
- Model::has() and Model:whereHas()
- Eager loading constraints (scroll down a little)