*/ class BlogFactory extends Factory { /** * Define the model's default state. * * @return array */ public function definition() { return [ 'title' => $this->faker->realText($maxNbChars = 20, $indexSize = 2), 'content' => $this->faker->realText($maxNbChars = 200, $indexSize = 2), 'tags' => json_encode(['Gaming', 'Video', 'Fashion']), 'authorId' => $this->faker->randomElement(User::query()->get('id')), 'bookmarked' => rand(0,10000), ]; } }