Laravel 5.8.17 Released With a “Tappable” Trait

Laravel 5.8.17 Released With a “Tappable” Trait

The Laravel team released Laravel 5.8.17 yesterday with a new Tappable trait, a dumpHeaders test method, and quite a few other new features.

First, a new dumpHeaders() method was added to the TestResponse class which helps you debug headers. Here’s the improvement over doing this manually:

$response = $this->get('/example');

// Previously
dd($response->headers->all());

// Ah, that's better
$response->dumpHeaders();

The new dumpHeaders method PR mentioned the dump() method, which you might not be familiar with but is also convenient:

// dd() the response content...
$response->dump();

Next, an ends_with validation rule was added, which looks like this:

$rules = [
'email' => 'required|ends_with:laravel.com,jasonmccreary.me',
];

Next, support for multiple columns arguments got added to the route:list command:

# Previously
php artisan route:list --columns=method --columns=uri --columns=name

Now

php artisan route:list --columns=method,uri,name
php artisan route:list --columns=method --columns=uri,name

A new Tappable trait was added to Illuminate\Support which you can define on a class like so:

use Illuminate\Support\Traits\Tappable;

class TappableClass {
use Tappable;
// ...
}

Here’s a before and after example:

// with tap method
$result = tap(TappableClass::make(), function ($tappable) {
$tappable->doSomething();
$tappable->doSomethingElse();
})->getResult();

// with Tappable trait
$result = TappableClass::make()->tap(function ($tappable) {
$tappable->doSomething();
$tappable->doSomethingElse();
})->getResult();

You can see the full list of fixes below, and the whole diff between 5.8.16 and 5.8.17 on GitHub. The full release notes for Laravel 5.8 are available in the GitHub 5.8 changelog:


v5.8.17

Added

  • Added Illuminate\Foundation\Testing\TestResponse::dumpHeaders() (#28450)
  • Added ends_with validation rule (#28455)
  • Added possibility to use a few columns arguments in the route:list command (#28459)
  • Added retryAfter in Mail\SendQueuedMailable and Notifications\SendQueuedNotifications object (#28484)
  • Added Illuminate\Foundation\Console\Kernel::scheduleCache() (6587e78)
  • Added support for multiple --path options within migrate commands (#28495)
  • Added Tappable trait (#28507)
  • Added support auto-discovery for events in a custom application directory, that sets via Illuminate\Foundation\Application::useAppPath() (#28493)
  • Added passing of notifiable email through reset link (#28475)
  • Added support flush db on clusters in PhpRedisConnection and PredisConnection (f4e8d5c)

Fixed

  • Fixed session resolver in RoutingServiceProvider (without bind of session in Container) (#28438)
  • Fixed route:list command when routes were dynamically modified (#28460, #28463)
  • Fixed required validation with multiple passes() calls (#28502)
  • Fixed the collation bug when changing columns in a migration (#28514)
  • Added password to the RedisCluster only if redis >= 4.3.0 (1371940)
  • Used escapeshellarg on windows symlink in Filesystem::link()(44c3feb)

Changed

  • Reset webpack file for none preset (#28462)


Thanks for reading

If you liked this post, share it with all of your programming buddies!

Follow us on Facebook | Twitter

Learn More

PHP with Laravel for beginners - Become a Master in Laravel

Projects in Laravel: Learn Laravel Building 10 Projects

Laravel for RESTful: Build Your RESTful API with Laravel

Fullstack Web Development With Laravel and Vue.js

Laravel 5.8 Ajax CRUD tutorial using Datatable JS

Laravel 5.8 Tutorial from Scratch for Beginners

Building a Vue SPA With Laravel

Building a BigCommerce App Using Laravel and React

Build RESTful API In Laravel 5.8 Example

A Complete Guide to Laravel 5.8 Installation

Build a CMS with Laravel and Vue

Build a Basic CRUD App with Laravel and Vue

Originally published on https://laravel-news.com

Laravel Framework Development Services | Laravel Web Development

CMARIX is leading Laravel Web application Development Service Provider with the track record of implementing diverse high-performance Laravel web applications with skilled Laravel developer team for clients across the globe<a href="https://www.cmarix.com/laravel-framework-development-services.html?utm_source=SB" target="_blank">.Continue</a>

CMARIX is leading Laravel Web application Development Service Provider with the track record of implementing diverse high-performance Laravel web applications with skilled Laravel developer team for clients across the globe.Continue

Mobile App Development Company India | Ecommerce Web Development Company India

Mobile App Development Company India | Ecommerce Web Development Company India

Best Mobile App Development Company India, WebClues Global is one of the leading web and mobile app development company. Our team offers complete IT solutions including Cross-Platform App Development, CMS & E-Commerce, and UI/UX Design.

We are custom eCommerce Development Company working with all types of industry verticals and providing them end-to-end solutions for their eCommerce store development.

Know more about Top E-Commerce Web Development Company

Laravel Development Company | Hire Laravel Developer

Laravel Development Company | Hire Laravel Developer

Get a free quote for custom Laravel Development Services from a trusted Laravel web development company. Hire Laravel Developers now @ best affordable rates

Get a free quote for custom Laravel Development Services from a trusted Laravel web development company. Hire Laravel Developers now at best affordable rates