Laravel v5.3.19 is now released

Laravel v5.3.19 is now released

Laravel released v5.3.19 which includes a few small changes and improvements as well as a complete rewrite of the middleware sorting so that middleware calls with parameters now work properly.

PHP Artisan make:model

A new addition to Laravel is the ability to specify the creation of a resourceful controller when you are creating a new Model through Artisan. This means you can pass a -c or --controller flag to make:model:

php artisan make:model Post --controller

Laravel Image Dimensions Validation

New in Laravel v5.3 is the ability to validate image files to ensure they meet certain dimensions and through the validator this can be setup with a string format:

'avatar' => 'dimensions:min_width=100,min_height=200,ratio=3/2'

Now in v5.3.19 this can be specified through a fluent syntax similar to unique and exists validation rules:


Laravel Validation in and not_in

The in and not_in validation received the ability to pass an array.

// Previous
// New

Then the same for not_in

// Previous
// New
Rule::notIn(['php', 'laravel'])

Either style is valid and the new object-based style parses down into the old way. So you are free to use whichever suits your app.

After Validation Hook

Now your controllers can have a new withValidator method so you can easily call any hooks after validation:

protected function withValidator($validator) 
  $validator->after(function($validator) {
    if ($this->somethingElseIsInvalid()) {
        $validator->errors()->add('field', 'Something is wrong with this field!');

Previously you had to manually setup the $validator = Validator::make() before you could use an after hook which meant you lost the ability to utilize the ValidatesRequests trait.

Upgrading Laravel

To get this latest version all you need to do is run composer update and you can find a complete list of changes in the changelog

Filed in: News / Laravel 5.3 / Releases


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

Laravel News Partners

Laravel Jobs

Laravel + Vue.JS developer
Remote or in Toronto Canada
Star Dot Hosting Inc
Full Stack or Back-End Developer
Alexandria, VA; Tallahassee, FL; Orlando, FL
Marketing for Change
Senior Quality Assurance Engineer
Bisnow Media
Senior PHP/Laravel Developer: Your Dream Work Environment
iPhone Photography School
Senior Software Engineer
Remote or San Francisco
Laravel Developer
Las Vegas, NV
V Shred
R&D Developer
Denver, CO