Laravel 8.3 Released

Laravel 8.3 Released

The Laravel team released v8.3.0 this week with JSON casting for database test assertions, the ability to use closures in queued batches, and added various facade method PHPDocs.

New castAsJson() method for Database Assertions

Andrew Brown contributed a castAsJson() method to the base Laravel test case to help assert JSON in the database:

$this->assertDatabaseHas('users', [
    'name' => 'Peter Parker',
    'email' => 'spidey@yahoo.com',
    'skills' => $this->castAsJson(json_encode(['web slinging', 'spidey-sense', 'sticky feet'])),
]);

Updated PHPDotEnv Version

Graham Campbell contributed an update to the PHPDotEnv version used in Laravel 8 to work around some reported issues upstream issues:

I am going to just patch phpdotenv 5.x to convert boolean values from $_ENV and $_SERVER to strings, instead of skipping over them as invalid. This should resolve this issue for people, without needing this hack.

Using a Closure in a Queued Batch

Mohamed Said contributed a feature that allows defining a closure in a queued batch:

And here’s an example from the pull request:

Bus::batch([
    new ProcessPodcast,
    function(){
        // ...
    },
    new ReleasePodcast
])->dispatch();

Updated PHPDocs for Facade Methods

@Adel contributed some missing PHPDocs for facade methods on the Log, Mail, Redirect, Route, URL, and Validator facades. These updates are quality-of-life improvements for those using IDEs that want auto-completion for facades.

Release Notes

You can see the full list of new features and updates below and the diff between 8.2.0 and 8.3.0 on GitHub. At the time of writing, an official changelog was not ready yet, but you can reference the future 8.x changelog updates on GitHub.

Filed in: News

Newsletter

Join 31,000+ others and never miss out on new tips, tutorials, and more.

Laravel News Partners

Laravel Jobs

Senior Laravel Developer
Remote
FPV Exchange
Senior Full-Stack Developer
Remote, USA Only
Givebutter
Senior PHP Developer
Cary, NC
INE
Backend PHP Developer
Hamburg
ABOUT YOU GmbH
Engineering Director
Vancouver or remote (EST/PST preferred)
Engine Digital