Jump24 - Laravel Developers that Click into Place. Never outsourced. Never offshored. Always exceptional.

Laravel 7.8 Released

Published on by

Laravel 7.8 Released image

Never Miss a Laravel Release 🚀

Sign up and get an email with each new Laravel release

The Laravel team released v7.8.0 with new takeWhile and takeUntil collection methods, along with all the latest new features, fixes, and changes in the 7.x branch. Let’s look at a few new features released in 7.8:

Redirector Signed Routes

Ryan Chandler contributed shortcut methods for generating signed routes from the Redirector service:

// Example
redirect()->to(URL::signedRoute(...));
 
// Using `signedRoute` and `temporarySignedRoute`
redirect()->signedRoute($route, $parameters, $expiration, $status, $headers);
 
// and
 
redirect()->temporarySignedRoute($route, $expiration, $parameters, $status, $headers);

Use-cases for these new methods are relatively edge-case, and I would advise reading the discussion in the Pull Request before reaching for these methods.

The takeUntil and takeWhile Collection Methods

Joseph Silber contributed a takeUntil and takeWhile collection methods, also making them support lazy collections. The documentation has updated details about these two methods.

First, here’s some examples of using the takeUntil method (until is an alias of takeUntil with this release):

$collection = collect([1, 2, 3, 4]);
 
$subset = $collection->takeUntil(function ($item) {
return $item >= 3;
});
 
$subset->all();
// [1, 2]
 
// Passing a primitive value
$subset = $collection->until(3);
$subset->all();
// [1, 2]

Next, here’s an example of takeWhile:

$collection = collect([1, 2, 3, 4]);
 
$subset = $collection->takeWhile(function ($item) {
return $item < 3;
});
 
$subset->all();
// [1, 2]

Check out Pull request #32496 and #32494 for implementation details, and the updated collection documentation for usage examples.

Release Notes

While we didn’t look at all the new features in this post, you can see the full list of new features and updates below and the diff between 7.7.0 and 7.8.0 on GitHub. The full release notes for Laravel 7.x are available in the latest v7 changelog:

v7.8.0

Added

  • Added signedRoute() and temporarySignedRoute() methods to Illuminate\Routing\Redirector (#32489)
  • Added takeUntil and takeWhile collection methods (#32494, #32496)
  • Added Illuminate\Container\ContextualBindingBuilder::giveTagged() (#32514)
  • Added methods withFragment and withoutFragment to Illuminate\Http\RedirectResponse (11d6bef, 0099591, 42c67a1, a1e741a)
  • Added exclude_without validation rule (4083ae5)

Fixed

  • Fixed compiled route actions without a namespace (#32512)
  • Reset select bindings when setting select (#32531)

Changed

  • Added warn in Illuminate/Support/Facades/Auth::routes() when laravel/ui is not installed (#32482)
  • Added auth to each master on Illuminate\Redis\Connections\PhpRedisConnection::flushdb() (837921b)
  • Register opis key so it is not tied to a deferred service provider (Illuminate/Encryption/EncryptionServiceProvider.php) (62d8a07)
  • Pass status code to schedule finish (#32516)
  • Check route:list –columns option case insensitively (#32521)

Deprecated

  • Deprecate Illuminate\Support\Traits\EnumeratesValues::until (#32517)
Paul Redmond photo

Staff writer at Laravel News. Full stack web developer and author.

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.

image
Jump24 - UK Laravel Agency

Laravel Developers that Click into Place. Never outsourced. Never offshored. Always exceptional.

Visit Jump24 - UK Laravel Agency
Curotec logo

Curotec

World class Laravel experts with GenAI dev skills. LATAM-based, embedded engineers that ship fast, communicate clearly, and elevate your product. No bloat, no BS.

Curotec
Bacancy logo

Bacancy

Supercharge your project with a seasoned Laravel developer with 4-6 years of experience for just $3200/month. Get 160 hours of dedicated expertise & a risk-free 15-day trial. Schedule a call now!

Bacancy
Tinkerwell logo

Tinkerwell

The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.

Tinkerwell
Get expert guidance in a few days with a Laravel code review logo

Get expert guidance in a few days with a Laravel code review

Expert code review! Get clear, practical feedback from two Laravel devs with 10+ years of experience helping teams build better apps.

Get expert guidance in a few days with a Laravel code review
PhpStorm logo

PhpStorm

The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

PhpStorm
Laravel Cloud logo

Laravel Cloud

Easily create and manage your servers and deploy your Laravel applications in seconds.

Laravel Cloud
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift
Harpoon: Next generation time tracking and invoicing logo

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing
Lucky Media logo

Lucky Media

Get Lucky Now - the ideal choice for Laravel Development, with over a decade of experience!

Lucky Media
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit

The latest

View all →
NativePHP for Mobile Is Now Free image

NativePHP for Mobile Is Now Free

Read article
Laravel Fuse: A Circuit Breaker Package for Queue Jobs image

Laravel Fuse: A Circuit Breaker Package for Queue Jobs

Read article
Generate Complete Application Modules with a Single Command using Laravel TurboMaker image

Generate Complete Application Modules with a Single Command using Laravel TurboMaker

Read article
`hasSole()` Collection Method in Laravel 12.49.0 image

`hasSole()` Collection Method in Laravel 12.49.0

Read article
Install Laravel Package Guidelines and Skills in Boost image

Install Laravel Package Guidelines and Skills in Boost

Read article
Bagisto Visual: Theme Framework with Visual Editor for Laravel E-commerce image

Bagisto Visual: Theme Framework with Visual Editor for Laravel E-commerce

Read article