DEV Community 👩‍💻👨‍💻

Morcos Gad
Morcos Gad

Posted on

New Things Added - Laravel 9.20 Released

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

$comments = $user->comments->random(5);

// Now
$comments = $user->comments;
$comments = $comments->random(min(5, count($comments)));
$comments = $user->comments->random(fn($items) => min(5, count($items)));
Enter fullscreen mode Exit fullscreen mode
Str::markdown('Use [Laravel](https://laravel.com)!') 
// <p>Use <a href="https://laravel.com">Laravel</a>!</p>

Str::inlineMarkdown('Use [Laravel](https://laravel.com)!') 
// Use <a href="https://laravel.com">Laravel</a>!
Enter fullscreen mode Exit fullscreen mode
<input type='email' name="email" @required( !auth()->user()->is_admin )>
<input type='password' name="password" @required( !auth()->user()->is_admin )>
Enter fullscreen mode Exit fullscreen mode
$replicated = $model->replicateQuietly();
Enter fullscreen mode Exit fullscreen mode

Image description

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://www.youtube.com/watch?v=gHpurEE5Lfs
Source :- https://www.youtube.com/watch?v=kkwQLpIitdE

Oldest comments (0)

Join 900k+ Developers on DEV

You'll see more of the content that brought you here.