What to expect in the next generation of Laravel Forge. Read the blog post
Blog /

General

General April 28, 2020

Laravel 7.9.0 - Blade Component Improvements

Today I released Laravel 7.9.0. This release includes two improvements for Blade components. # ## Blade Echo Within Attributes First, the release fixes a developer experience issue when using Blade components in combination with Laravel Livewire. Previously, specifying a wire:click attribute on a component that utilizes an in-scope PHP variable was very cumbersome since it required binding the attribute as a raw PHP expression: ``` :wire:click="'selectPlan(\''.$plan['id'].'\')" /> ``` Beginning in Laravel 7.9.0, you may use the more expected Blade echo syntax: ``` "selectPlan('{{ $plan['id'] }}')"> ``` # ## Parameterless Component Methods In previous releases of Laravel 7.x, any public component methods that did not require any arguments could be access as variables. For example, imagine a component that has a public countries method to retrieve a list of countries. This method's results could be access like so: ``` {{ $countries }} ``` This was unintuitive behavior and inconsistent behavior since developers naturally try to invoke the variable. Beginning in Laravel 7.9.0, public component methods that do not require arguments can be accessed as a variable or by invoking the variable as a callable: ``` {{ $countries() }} ```

Taylor Otwell

General February 17, 2020

Laracon US 2020 Coupon Contest

We've partnered with ContestKit to offer the chance to win a 20% coupon for Laracon US 2020 tickets! **We will not be using the collected email addresses for anything other than notifying those who win and we will not be sharing or selling the email addresses to any outside parties. All email addresses will be permanently deleted when the contest is over in one week!** [](#)

Taylor Otwell

General October 8, 2019

Password Confirmation

The Laravel v6.2.0 release ships with a new password confirmation feature. This feature allows you to attach a `password.confirm` middleware to routes where you want a user to re-confirm their password. `Route::get('/secrets', 'SecretsController@show')->middleware('password.confirm');` If you attempt to access the route, you will be prompted to confirm your password, similar to what you may have seen on other applications like GitHub: ![](https://laravel-blog-assets.s3.amazonaws.com/QkFmXDwFKnndTxmecVyoTlSq4E1lMrpGTNgahNYw.png)Confirming the password will store a timestamp in the user's session that lasts for three hours by default so users do not have to enter their password during that period again. You may customize this duration using a new `password_timeout` configuration option in the `auth` configuration file. In addition, a new `password` validation rule has been added to the framework. This validation rule may be used to validate that a given password matches the user's existing password.

Dries Vints

General April 3, 2019

Automatic Event / Listener Discovery

Yesterday we shipped Laravel 5.8.9. Included in this release is the ability to have the framework automatically register your events and listeners. However, since this is a patch release, you must opt-in to this behavior. To do so, define the `shouldDiscoverEvents` method on your application's `EventServiceProvider`. To enable event discovery, this method should return `true`: ``` /**  * Determine if events and listeners should be automatically discovered.  *  * @return bool  */ public function shouldDiscoverEvents() {   return true; } ``` By default, all listeners within your application's `Listeners` directory will be scanned. If you would like to define additional directories to scan, you may override the `discoverEventsWithin` method in your `EventServiceProvider`. In production, you likely do not want the framework to scan all of your listeners on every request. Therefore, during your deployment process, you should run the `event:cache` Artisan command to cache a manifest of all of your application's events and listeners. This manifest will be used by the framework to speed up the event registration process. We hope you enjoy this new feature!

Taylor Otwell

Showing 21 - 25 of 25 results

Stay connected with the latest Laravel news