Posted: 26-02-2019

Laravel 5.8 released

Laravel 5.8 released

Laravel 5.8 has been released and available to download.

This new release introduces several new features, bug fixes and improvements.
According to the Release notes will receive bug fixes and updates until August 2019 and security fixes until February 2020.

Upgrade time is estimated around 1 hour.

Upgrading To 5.8.0 From 5.7 guide is availiable  here.

Hereafter a list of new features taken from the Laravel 5.8 Release Notes.

Auto-Discovery Of Model Policies

Laravel 5.8 introduces auto-discovery of model policies as long as the model and policy follow standard Laravel naming conventions. Specifically, the policies must be in a Policies directory below the directory that contains the models. So, for example, the models may be placed in the app directory while the policies may be placed in the app/Policies directory. In addition, the policy name must match the model name and have a Policy suffix. So, a Usermodel would correspond to a UserPolicy class.
Improved Email Validation

Laravel 5.8 introduces improvements to the validator's underlying email validation logic by adopting the egulias/email-validator package utilized by SwiftMailer. Laravel's previous email validation logic occasionally considered valid emails, such as example@bär.se, to be invalid.
Artisan Serve Improvements
In previous releases of Laravel, Artisan's serve command would serve your application on port 8000. If another serve command process was already listening on this port, an attempt to serve a second application via serve would fail. Beginning in Laravel 5.8, serve will now scan for available ports up to port 8009, allowing you to serve multiple applications at once.

PHP dotenv
Laravel 5.8 now is compatible with PHP dotenv 3.0 that support for multiline variables

String and Array Helpers are Deprecated
All array_* and str_* global helpers have been deprecated.
You should use the Illuminate\Support\Arr and Illuminate\Support\Str methods directly or using the Alias Arr and Str just added in the app.php config files.

Blade File Mapping
When compiling Blade templates, Laravel now adds a comment to the top of the compiled file which contains the path to the original Blade template.

DynamoDB Cache / Session Drivers
Laravel 5.8 introduces DynamoDB cache and session drivers. DynamoDB is a serverless NoSQL database provided by Amazon Web Services. The default configuration for the dynamodb cache driver can be found in the Laravel 5.8 cache configuration file.

Carbon 2.0 Support
Laravel 5.8 provides support for the ~2.0 release of the Carbon date manipulation library.

Eloquent HasOneThrough Relationship

Higher Order orWhere Eloquent
Laravel 5.8 introduces a "higher order" orWhere method that allows you to fluently chain these scopes together without the use of Closures:

$users = App\User::popular()->orWhere->active()->get();


Token Guard Token Hashing
Laravel's token guard, which provides basic API authentication, now supports storing API tokens as SHA-256 hashes. This provides improved security over storing plain-text tokens. To learn more about hashed tokens, please review the full API authentication documentation.Pheanstalk 4.0 SupportLaravel 5.8 provides support for the ~4.0 release of the Pheanstalk queue library. If you are using Pheanstalk library in your application, please upgrade your library to the ~4.0release via Composer.
MethodPSR-16 Cache Compliance
Multiple Broadcast Authentication Guards
Default Scheduler Timezone
Artisan Call Improvements Mock / Spy Testing Helper Methods
Eloquent Resource Key Preservation