Laravel 6.0 :

Laravel present new form documentation with laravel 6, new highlights and featuures . Still not give access of code however when it will be accessible. laravel 6 gives new component and a few changes from laravel 5.8.

Some of the enormous new highlight I will list here so it can help you when you start utilizing laravel 6 .

laravel6

laravel6

Let’s see some new features provided in Laravel 6.0 version :

In Laravel Helpers of String & Array Moved To Package :

Laravel 6 have been removed all str_ and array_ helpers functions from by default. laravel 6 introduce new composer package for string and array helpers function. helpers can use the Illuminate\Support\Str and Illuminate\Support\Arr classes.

If you want to use array and string helpers in laravel 6 then you need to use following composer package for helper.

composer require laravel/helpers

Supported Carbon 2.0 :

In laravel 6, they removed Carbon 1.x version of carbon and they added Carbon 2.0 in laravel 6. So you can read and undertand Carbon 2.0 documentation what they added new.

Add cursor method in Eloquent :

Laravel 6 added new database eloquent method as cursor(). using cursor() method it will return "Illuminate\Support\LazyCollection" instance.

You can use as like bellow:

$posts = Post::cursor();
   
foreach ($posts as $post) {
      
}

Update on Eloquent BelongsTo::update Method

In Laravel 6, they give mass assignment protection on belongs to update method. When we are using relation with belongs to then we can update using function. But they not provide mass assignment protection.

In this upgrade, it will provide mass assignment protection. You need to use as like bellow:

/* Without mass assignment protection */
$book->author()->update(['name' => 'Hardik']);
   
/* With mass assignment protection */
$book->author->update(['name' => 'Hardik']);

Primary Key Type Declaration :

Laravel 6 made this update because of it's improve performance optimizations using set primary key on your model. So basically, if you are using string column data type with primary key then you need to set it on your model as like bellow:

Read Also: Laravel 5.8 New Features List

/**
 * The "type" of the primary key ID.
 *
 * @var string
 */
protected $keyType = 'string';

Read full description of Laravel new features and I hope so you like it :Laravel 6.0 Upgrade

 

Related Posts

Web Development

News Portal Website Development Strategy Plan

News occupies a vital part of people’s routine today. And, the proliferation of the internet, followed by a surge in mobile devices, has significantly increased the number of users with digital readership. A reliable technology Read more…

Web Development

How to Choose Front-End Framework for Your Company

The proliferation of front-end frameworks is a resultant of advancing web technology. They are used for web apps as they offer a great user experience. Further, they make the job of the web coders and Read more…

Web Development

Field Service Management Software Solutions

In businesses, efficient control of distributed teams has become one of the most complex tasks. It has become even challenging to offer a unique customer experience while managing diverse customer requests. As for most of Read more…