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=nameNow
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:
Illuminate\Foundation\Testing\TestResponse::dumpHeaders()
(#28450)ends_with
validation rule (#28455)columns
arguments in the route:list
command (#28459)retryAfter
in Mail\SendQueuedMailable
and Notifications\SendQueuedNotifications
object (#28484)Illuminate\Foundation\Console\Kernel::scheduleCache()
(6587e78)–path
options within migrate commands (#28495)Tappable
trait (#28507)Illuminate\Foundation\Application::useAppPath()
(#28493)PhpRedisConnection
and PredisConnection
(f4e8d5c)RoutingServiceProvider
(without bind of session
in Container
) (#28438)route:list
command when routes were dynamically modified (#28460, #28463)required
validation with multiple passes()
calls (#28502)RedisCluster
only if redis
>= 4.3.0
(1371940)escapeshellarg
on windows symlink in Filesystem::link()
(44c3feb)Thanks for reading ❤
If you liked this post, share it with all of your programming buddies!
Follow us on Facebook | Twitter
☞ 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 #web-development