DEV Community

Morcos Gad
Morcos Gad

Posted on • Edited on

5 4

New Things Added - Laravel 9.12 Released

Let's get started quickly I found new things in Laravel 9.12 Released I wanted to share with you.

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');
Enter fullscreen mode Exit fullscreen mode

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),
]));
Enter fullscreen mode Exit fullscreen mode

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),
    ];
}
Enter fullscreen mode Exit fullscreen mode

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

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay