The Laravel team released v5.8.25 this week with the ability to output the route:list report in JSON format and improvements for asserting view data in tests.

Please note that since v5.8.25 was released, version 5.8.26 was tagged shortly after with a revert and you should update to v5.8.26. The bulk of the most recent updates are in Laravel 5.8.25 which we highlight below.

First, you can now output the route list from the CLI as JSON:

php artisan route:list --json


Next, tests can assert all the view data by exposing the View::gatherData()method as public:

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


// Example assertion
$this->assertArrayHasKey('someKey', $response->original->gatherData());

A longstanding issue was resolved by Dries Vints for passing column parameters on the paginate method:

DB::table('posts')->paginate(5, ['title', 'content']);

Check out Pull Request #28937 for more details on the test coverage added and the code change.

You can see the whole diff between 5.8.24 and 5.8.25on GitHub. We will include release notes once the changlog has been updated, but GitHub is always the most accurate place to see releases.

You can read details and more Laravel news at Laravel News Website.

(Visited 96 times, 1 visits today)

Leave A Comment

Your email address will not be published. Required fields are marked *