Laravel factory changed in Laravel 8

In Laravel 8 there are some changes in factory. Let's see that 👇

PostsTableSeeder.php

factory(App\Models\Post::class, 30)->create();

// to 👇

\App\Models\Post::factory()->count(30)->create();

PostFactory.php

protected $model = App\Models\Post::class;
// to 👇
protected $model = \App\Models\Post::class;

------------------------------------------

// and you have to change

'title' => $faker->text(50),
           'body' => $faker->text(200)
// to 👇
'title' => $this->faker->text(50),
        'body' => $this->faker->text(200)