55 / 100

Finally, the latest version of Laravel is released, i.e., version 10.1. It is among other things removed return types for controller stubs and processed standard input.

Following major releases, Laravel 10 tagged several patch-level versions, with ‘v10.1.0’ being the most recent. What’s new and updated in the most recent Laravel 10 release is listed below:

You can use standard input with a running process. Standard input can be supplied to a process via the input method thanks to Peter Fox’s contribution of the ‘Process :: input()’ method:

The code results in ‘hello world’ being passed to standard input for the ‘pbcopy’ command.

Removing Return Types in the Controller Stubs

Return types, such as controller stubs, were added to userland code in the Laravel 10 major release. Nevertheless, because Laravel controllers can return various data types, this led to misunderstandings (i.e., array, string, View, etc.).

Pull Request #46166 sought to return ‘mixed’ types while providing types to prevent issues in created controllers. Finally, all return types from controllers were eliminated in pull request #46166. Regardless of your position, there are several ways for you to modify stubs if you prefer native return types in produced controllers.

If you want to learn more about tailoring controller stubs to your tastes, see Customizing Stubs in Laravel.

Monitor Command: Display Queue Connection

The artisan queue:  command now has a queue connection, thanks to Gustavo Sobrinho. Users who have numerous queue connections can now view all of their connections in a single command thanks to this change:

 


 Process::input('hello world') >run('pbcopy');

 

Release Notes

The full list of improvements and new features is shown below, along with a link to GitHub’s comparison of versions 10.0.0 and 10.1.1. Directly taken from the changelog are the release notes that follow:

As mentioned on the Laravel official website, here are the additions and changes done on the Laravel versions.

v10.1.1

  • Added – Resolve cache drivers as necessary (#46203)
  • Fixed – Fixed ‘Illuminate/Collections/Arr::shuffle()’ for empty array (0c6cae0)

v10.1.0

  • Fixed – 0 is no longer accepted as a valid timestamp due to a bug (#46158).
  • Correct custom themes that don’t reset when using the Markdown renderer (#46200)
  • Changed – In Arr:random and Arr:shuffle, use secure randomness (#46105)
  • On controller stubs, use mixed return type (#46166)
  • Utilize the InteractsWithDictionary collection in Eloquent (#46196)

v10.0.3

Added – Added missing expression support for pluck in Builder (#46146)

v10.0.2

Added – Register policies automatically to the gate (#46132)

v10.0.1

  • Added – Standard Input can be applied to PendingProcess (#46119)
  • Fixed – Fix Expression string casting (#46137)
  • Changed – Add AddQueuedCookiesToResponse to middlewarePriority so it is handled in the right place (#46130)
  • Show queue connection in MonitorCommand (#46122)