Skip to main content

Laravel 10 is Released, Whats New in Laravel 10?

The latest version of Laravel, which is Laravel 10, has been launched. It comes with several new features, such as the minimum required PHP version being upgraded to v8.1, a new package called Laravel Pennant, invokable validation rules, and the addition of native type declarations, among other updates.

Prior to Laravel 9, major versions of the framework were launched twice a year or approximately every six months. However, the core team changed their approach and moved to an annual schedule, with Laravel 9 being released in February 2022 instead of September 2021 as originally planned. The Laravel framework uses a range of community-driven packages and nine Symfony components to provide various features. With the release of Symfony 6.0 slated for November, the Laravel team opted to delay the Laravel 9 release to 2022 to allow them to upgrade their underlying Symfony components to Symfony 6.0 earlier. This approach will enable them to align their releases with Symfony's and provide users with a better experience. Going forward, the Laravel team will follow a yearly release schedule, with Laravel 10 scheduled for February 14th, 2023, and Laravel 11 slated for Q1 2024. Laravel 9 will continue receiving bug fixes until August 8th, 2023, and security fixes until February 14th, 2024. Laravel 10, on the other hand, will receive bug fixes until August 6th, 2024, and security fixes until February 14th, 2025.

Here are some of the notable new features included in Laravel 10:

Dropped support for PHP 8.0

Laravel 10 will no longer support PHP versions <=v8.0, and the minimum required version is now PHP ^8.1. We can anticipate seeing new 8.1 features being used in the framework, such as readonly properties, based on a comparison between the master and 9.x versions.

Laravel Pennant

Laravel Pennant is a Feature Flag package developed by the Laravel team that will come bundled with Laravel 10. Feature flags enable you to safely roll out new application features, A/B test new interface designs, and implement a trunk-based development strategy, among other things.

This package is the latest addition to the official packages provided by the core team, ensuring that users have access to a well-built and thoroughly tested package that delivers excellent functionality.

Laravel Process Layers

The Laravel Process layer streamlines the testing and running of CLI processes.

Here's an example of how to use it:

use Illuminate\Support\Facades\Process;

 

$result = Process::run('ls -la');

 

$result->successful();

$result->failed();

$result->exitCode();

$result->output();

$result->errorOutput();

$result->throw();

$result->throwIf($condition);

The Process layer offers several useful features, such as:

  • Fluent methods for constructing a process instance before executing it
  • Output handling for processes as they run
  • Asynchronous processes
  • Process Pools
  • Robust testing capabilities via fake()
  • Preventing the occurrence of stray processes during testing

Overall, testing processes has never been more straightforward than with the Laravel Process layer.

Native Declaration

Laravel 10's application skeleton code will now have native type declarations, which means that all code generated by the framework in userland will have type hints and return types. However, this implementation comes with certain limitations, which are discussed in the article. Nevertheless, the addition of types will be a welcome feature when starting new projects. The types are added in a manner that incorporates the latest PHP type-hinting features while maintaining backward compatibility at the framework level. Return types and method arguments will now have type declarations, redundant annotations will be removed where possible, and closure arguments can use user-defined types. Typed properties are not included in this implementation.

Invocable Validation Rules

In the latest release of Laravel - version 10 - there's a nifty new feature that will make your life easier when it comes to validation rules. Say goodbye to the hassle of having to implement the Illuminate\Contracts\Validation\Rule interface every time you create a new rule class. With invokable validation rules, it's as simple as creating a new class and adding the __invoke() method. And the best part? Invokable rules are now the default in Laravel 10, so you can save time and effort while keeping your code concise and clean. If you're feeling adventurous, you can even try out the --implicit flag to create implicit invokable rules with ease. 

String Password Helper

With Laravel's Str::password method, you can create strong, randomized passwords with ease. The method allows you to specify the length of the password, which can include a mix of letters, numbers, symbols, and spaces. By default, passwords generated by the method are 32 characters long.

Laravel 9 Deprecation

Laravel 10 will remove methods that were marked as deprecated in Laravel 9. To help developers with the upgrade process, the release upgrade guide will provide information on all deprecated methods, their potential impact, and how to upgrade closer to the release.

Here is a list of deprecations that were found when comparing the Laravel framework's master branch to the 9.x branch at the time of writing:

  • Various deprecations will be removed in Pull Request #41136
  • The deprecated dates property will be removed in Pull Request #42587
  • The handleDeprecation method will be removed in Pull Request #42590
  • The deprecated assertTimesSent method will be removed in Pull Request #42592
  • The $defaultName property of ScheduleListCommand will be removed in commit 419471e
  • The deprecated Route::home method will be removed in Pull Request #42614
  • The dispatchNow functionality will be removed in Pull Request #42591.
  • For example, the assertTimesSent method will be removed in Laravel 10 as it was marked as deprecated in Laravel 9.



Comments

Popular posts from this blog

Cara Disable Antimalware Service Executable di Windows 10

Disadari atau tidak, Windows 10 (dan juga windows-windows lainnya) hadir dengan banyak sekali aplikasi bloatware (aplikasi yang tidak perlu-perlu amat dimiliki oleh end user). Contohnya, adalah aplikasi yang seharusnya sudah tergantikan fungsinya oleh antivirus, seperti Antimalware Service Executable . Aplikasi ini dicurigai membuat Windows 10 mengalami inefisiensi memori/RAM, memakan resource yang tinggi, dengan Load yang tinggi (tanpa limit terkadang). Nah, berikut adalah cara men-disable nya: Tekan tombol Windows + I untuk membuka apliaksi Windows Setting. Pilih icon menu Update and Security Pilih lagi menu disamping kiri Windows Security Pada jendela baru yang muncul, ada pilihan Virus & Threat protection Klik ini Lalu matikan proses Real-time protection tersebut. Dengan Regedit. Buka dialog regedit, Windows + R dan ketik ‘regedit’ Cari Folder regedit ini HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender Buat sebuah DWORD baru dengan klik kanan

Setup Debian 11 Official Repository In sources.list (/etc/apt/sources.list)

When you install Debian 11 using a DVD, the OS installer sets the DVD as the source for getting packages for your system if you didn't choose to scan for network mirrors. Due to this reason, the system would ask you to insert a DVD if the disc is not present in the DVD drive when you try to install any software.  Also, the packages on DVD may not be the latest release.  So, we need to get the packages from the Internet. Media change: please insert the disc labeled 'Debian GNU/Linux 11.0.0 _Bullseye_ - Official amd64 DVD Binary-1 20210814-10:04' in the drive '/media/cdrom/' and press [Enter] The /etc/apt/sources.list file with DVD as a source would look something like below. # deb cdrom:[Debian GNU/Linux 11.0.0 _Bullseye_ - Official amd64 DVD Binary-1 20210814-10:04]/ bullseye contrib main deb cdrom:[Debian GNU/Linux 11.0.0 _Bullseye_ - Official amd64 DVD Binary-1 20210814-10:04]/ bullseye contrib main deb http://security.debian.org/debian-security bullseye-security

Cara Membuat Live USB VMWare ESXi 6.7 di Linux (Debian/CentOS)

VMWare ESXi 6.7 menyediakan satu installer dalam format CDROM ISO. Dalam tutorial kali ini kita akan membuat sebuah live USB dengan menggunakan sistem Linux, misalnya Debian dan CentOS. Untuk keperluan tutorial kali ini silakan pastikan sudah ada download installer ISO ESXi 6.7 dari https://my.vmware.com Siapkan satu USB Flashdisk dengan kapasitas lebih dari 1GB. Format dalam satu partisi dengan tool yang biasa dipakai dalam format partisi FAT32. Misal dengan FDISK: [sourcecode] fdisk /dev/sdX [/sourcecode] format ke FAT32: [sourcecode]mkfs.fvat -F 32 -n USB /dev/sdX1[/sourcecode] selanjutnya, kita buat USB tersebut bootable dengan syslinux. Bagi linuxnya belum ada syslinux, silakan install dulu (apt-get install syslinux atau yum install syslinux).