Output the route:list Command as JSON in Laravel 5.8.25

Output the route:list Command as JSON in Laravel 5.8.25

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.25 on GitHub. We will include release notes once the changlog has been updated, but GitHub is always the most accurate place to see releases.

Filed in: News / Releases


Join the weekly newsletter and never miss out on new tips, tutorials, and more.

Laravel News Partners

Laravel Jobs

Full Stack or Back-End Developer
Alexandria, VA; Tallahassee, FL; Orlando, FL
Marketing for Change
Full Stack Software Engineer
Atlanta, GA or Remote
Laravel/PHP Developer
Chicago, IL
Neon One
Software Engineer, Web Applications
Vaughan, ON, Canada
Blast Motion
Contract Services Software Engineer (Laravel | Vue | Tailwind)
Riverbed Technology
Senior Laravel Developer
Wilmington, NC
GE Software Inc.
Senior Full Stack Developer (PHP | Vue | DDD)
Charleston, SC