• +91 9806724185,+91 9685733903
  • +91 9806724185

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

Why Laravel Development is perfect for Custom Application

In the web development process, choosing the right framework comes as one of the most crucial decision. This lets to plan the respective app’s requirement in advance, thus provides an idea about the web application Read more…

Web Development

What’s New In Angular 8.0 Updates

Angular 8.0 Released in May 2019. Yes, we are talking about the new features of Angular new version !! What New features in Angular 8? Compared to Angular 7, there are a whole lot of Read more…

Web Development

Build Progressive Web Apps with Laravel Integration

Understand PWA First : Progressive Web App (PWA) can be characterized as applications that join the best features of both –Native applications and Websites. As they are continually advancing, they are named as 'Progressive' and Read more…