Let's get started quickly I found new things in Laravel 9.12 Released I wanted to share with you.
- Throw If HTTP Client Method https://github.com/laravel/framework/pull/42260
method to the HTTP client that will throw an exception if the condition evaluates to true
// Throws RequestException
return Http::baseUrl('https://foo.bar')
       ->throwIf(true)
       ->get('not-found');
// Doesn't throw
return Http::baseUrl('https://foo.bar')
       ->throwIf(false)
       ->get('not-found');
- Delaying Notifications Per Channel https://github.com/laravel/framework/pull/42239
You can pass an array to the delay method to specify the delay amount for specific channels
$user->notify((new InvoicePaid($invoice))->delay([
    'mail' => now()->addMinutes(5),
    'sms' => now()->addMinutes(10),
]));
You can also define a withDelay method on the notification class
/**
 * Determine the notification's delivery delay.
 *
 * @param  mixed  $notifiable
 * @return array
 */
public function withDelay($notifiable)
{
    return [
        'mail' => now()->addMinutes(5),
        'sms' => now()->addMinutes(10),
    ];
}
- Add whereNotMorphedTo, orWhereNotMorphedTo https://github.com/laravel/framework/pull/42264
I hope you enjoyed with me and to learn more about this release visit the sources and search more. I adore you who search for everything new.
Source :- https://laravel-news.com/laravel-9-12-0
Source :- https://www.youtube.com/watch?v=NyI9GNI8MlI
 

 
    
Top comments (0)