database/factories/CommentFactory.php
/**
     * Define the model's default state.
     *
     * @return array
     */
Define the model's default state.
@return array
Define the model ' s default state . @return array
public function definition()
    {
        $user = User::factory()->create();
        $content = Content::factory()->create();
        $date = $this->faker->dateTimeThisMonth();
        return [
            "user_id" => $user,
            "content_id" => $content,
            "body" => $this->faker->paragraph(),
            "created_at" => $date,
            "updated_at" => $date,
        ];
    }
public function definition ( ) { $ user = User :: factory ( ) -> create ( ) ; $ content = Content :: factory ( ) -> create ( ) ; $ date = $ this -> faker -> dateTimeThisMonth ( ) ; return [ " user_id " => $ user , " content_id " => $ content , " body " => $ this -> faker -> paragraph ( ) , " created_at " => $ date , " updated_at " => $ date , ] ; }
Define the model's default state.
Define the model ' s default state .