Code review at scale is broken. Here’s how Augment Code is fixing it.

Laravel 6.12.0 Released

Published on by

Laravel 6.12.0 Released image

Never Miss a Laravel Release 🚀

Sign up and get an email with each new Laravel release

The Laravel team released v6.12.0 this week with the ability to load factories from a package, dump test session data, and many other features! This release is jam-packed with contributions that add some sweet syntactic sugar for repetitive things like filtering a request input as a Boolean.

Here’s a look at some of the highlight new features:

Load Factories from a Package

Gergo D. Nagy contributed a pull request to load factory files in a service provider. Packages can benefit from using existing factories from a package instead of recreating them:

// from a service provider...
$this->loadFactoriesFrom('source/database/factories');
 
$this->loadFactoriesFrom([
'source_one/database/factories',
'source_two/database/factories',
]);

Dump Session in a Test Response

Andrew Brown contributed a dumpSession() method to the TestResponse class that provides convenience around dumping the whole session or specific keys:

$response->dumpSession();
$response->dumpSession('example');
$response->dumpSession(['example', 'example2']);

Str::isUuid() Helper

@leonhh contributed a isUuid() string helper by extracting the logic from the ValidatesAttributes trait used the validate UUIDs:

// Returns true
Str::isUuid('a0a2a2d2-0b87-4a18-83f2-2529882be2de');
 
// Returns false
Str::isUuid('laravel');

Request Boolean Method

Lasse Rafn contributed a Request::boolean() method which takes input and filters it through filter_var to determine if the value is boolean. Here are some examples:

$request = Request::create('/', 'GET', [
'example1' => 'true',
'example2' => 'false',
'checked' => 1,
'checked2' => '1',
'unchecked' => 0,
'unchecked2' => '0',
'name' => 'Jane Doe'
]);
 
$request->boolean('example1'); // true
$request->boolean('example2'); // false
$request->boolean('checked'); // true
$request->boolean('checked2'); // true
$request->boolean('unchecked'); // false
$request->boolean('unchecked2'); // false
$request->boolean('name'); // false

Factory Builder createMany()

Mohamed Benhida contributed the factory createMany() method, which aids in creating multiple records with custom data:

// Before
factory(User::class)->create([
'name' => 'Taylor',
]);
 
factory(User::class)->create([
'name' => 'John',
]);
 
// After
factory(User::class)->createMany([
['name' => 'Taylor'],
['name' => 'John'],
]);

You can see the full list of new features and updates below and the whole diff between 6.11.0 and 6.12.0 on GitHub. The full release notes for Laravel 6.0 are available in the GitHub v6 changelog:

v6.12.0 (2020-01-21)

Added

  • Added ServiceProvider::loadFactoriesFrom() method (#31133)
  • Added TestResponse::dumpSession() method (#31131)
  • Added Str::isUuid() method (#31148)
  • Restored phpunit 7 support (#31113)
  • Added Request::boolean() method (#31160)
  • Added Database\Eloquent\FactoryBuilder::createMany() (#31171, 6553d59)
  • Added missing options for PhpRedis (#31182)

Fixed

  • Fixed Cache\RedisLock::acquire() (#31168, 8683a3d)
  • Fixed database url parsing for connections with no database specified (#31185)
  • Prevent ambiguous column with table name prefix (#31174)

Optimization

  • Fixed memory usage on downloading large files (#31163)

Changed

  • Replace Event Dispatcher in resolved cache repositories when Event::fake() is used (#31119, 0a70beb)
Paul Redmond photo

Staff writer at Laravel News. Full stack web developer and author.

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.

image
Curotec

Curotec helps software teams hire the best Laravel developers in Latin America. Click for rates and to learn more about how it works.

Visit Curotec
Curotec logo

Curotec

World class Laravel experts with GenAI dev skills. LATAM-based, embedded engineers that ship fast, communicate clearly, and elevate your product. No bloat, no BS.

Curotec
Bacancy logo

Bacancy

Supercharge your project with a seasoned Laravel developer with 4-6 years of experience for just $3200/month. Get 160 hours of dedicated expertise & a risk-free 15-day trial. Schedule a call now!

Bacancy
Tinkerwell logo

Tinkerwell

The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.

Tinkerwell
Cut PHP Code Review Time & Bugs into Half with CodeRabbit logo

Cut PHP Code Review Time & Bugs into Half with CodeRabbit

CodeRabbit is an AI-powered code review tool that specializes in PHP and Laravel, running PHPStan and offering automated PR analysis, security checks, and custom review features while remaining free for open-source projects.

Cut PHP Code Review Time & Bugs into Half with CodeRabbit
Get expert guidance in a few days with a Laravel code review logo

Get expert guidance in a few days with a Laravel code review

Expert code review! Get clear, practical feedback from two Laravel devs with 10+ years of experience helping teams build better apps.

Get expert guidance in a few days with a Laravel code review
PhpStorm logo

PhpStorm

The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

PhpStorm
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift
Harpoon: Next generation time tracking and invoicing logo

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing
Lucky Media logo

Lucky Media

Get Lucky Now - the ideal choice for Laravel Development, with over a decade of experience!

Lucky Media
Lunar: Laravel E-Commerce logo

Lunar: Laravel E-Commerce

E-Commerce for Laravel. An open-source package that brings the power of modern headless e-commerce functionality to Laravel.

Lunar: Laravel E-Commerce
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit

The latest

View all →
Laravel Gets a Claude Code Simplifier Plugin image

Laravel Gets a Claude Code Simplifier Plugin

Read article
Laravel Boost Update Adds Support for the New MCP Protocol image

Laravel Boost Update Adds Support for the New MCP Protocol

Read article
Pest Adds withHost for Browser Testing Subdomains in Laravel image

Pest Adds withHost for Browser Testing Subdomains in Laravel

Read article
Run Artisan Make Commands in Laravel VS Code Extension image

Run Artisan Make Commands in Laravel VS Code Extension

Read article
Livewire 4 Is Dropping Next Week, and wire:transition Makes Animations Effortless image

Livewire 4 Is Dropping Next Week, and wire:transition Makes Animations Effortless

Read article
Laravel 12.45.1, 12.45.2, and 12.46.0 Released image

Laravel 12.45.1, 12.45.2, and 12.46.0 Released

Read article