DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Morcos Gad
Morcos Gad

Posted on • Updated on

New Things Added - Laravel 9.21 Released

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

loadCount() - whenCounted()

class PostController
{
    public function show(Post $post)
    {
        return new PostResource($post->loadCount('comments'));
    }
}

class PostResource extends PostResource
{
    public function toArray($request)
    {
        return [
            'id' => $this->id,
            'comments_count' => $this->whenCounted('comments'),
        ];
    }
}
Enter fullscreen mode Exit fullscreen mode
$request->enum('status', StatusEnum::class);
Enter fullscreen mode Exit fullscreen mode
php artisan model:show User
Enter fullscreen mode Exit fullscreen mode
php artisan about
Enter fullscreen mode Exit fullscreen mode

https://laravel-news.com/customize-laravel-about-command

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=Ilv7jYj2_GU
Source :- https://www.youtube.com/watch?v=JR42YZ9ZbNQ
Source :- https://www.youtube.com/watch?v=25Zg5MvXFUo
Source :- https://www.youtube.com/watch?v=PBBTgJwMUsk
Source :- https://laravel-news.com/laravel-9-21-0

Latest comments (0)

An Animated Guide to Node.js Event Lop

Node.js doesn’t stop from running other operations because of Libuv, a C++ library responsible for the event loop and asynchronously handling tasks such as network requests, DNS resolution, file system operations, data encryption, etc.

What happens under the hood when Node.js works on tasks such as database queries? We will explore it by following this piece of code step by step.