fzaninotto/Faker 的备用 imageUrl

Alternative imageUrl for fzaninotto/Faker

https://github.com/fzaninotto/Faker 中的函数 imageUrl() 不再起作用

    public function load(ObjectManager $manager)
            {
                
                $faker = Factory:: create('FR-fr');
                
                for ($i = 1; $i < 30; $i++) 
             {     
                    $title = $faker->sentence();
                    $coverImage = $faker->imageUrl(1000, 350);
             }
       

  

还有什么选择?

经过研究,我找到了以下解决方案:

public function load(ObjectManager $manager)
{
    $faker = Factory:: create('FR-fr');

    for ($i = 1; $i < 30; $i++) 
 {
        $title = $faker->sentence();
        $coverImage = "https://picsum.photos/1200/350?random=".mt_rand(1, 55000);
 }