Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Fakerphp Picsum Images Laravel Package

smknstd/fakerphp-picsum-images

View on GitHub
Deep Wiki
Context7

Fakerphp Picsum Images

Latest Version on Packagist GitHub Tests Action Status Total Downloads

Introduction

Alternative image provider for fakerphp using picsum.photos

This package has been forked from mmo/faker-images for fzaninotto/faker (deprecated ~ Oct 2020).

Ressources

Installation

You can install the package via composer in dev dependency section:

composer require --dev smknstd/fakerphp-picsum-images

Usage

$faker = \Faker\Factory::create();
$faker->addProvider(new \Smknstd\FakerPicsumImages\FakerPicsumImagesProvider($faker));

// return a string that contains a url like 'https://picsum.photos/800/600/'
$faker->imageUrl(width: 800, height: 600); 

// return a string that contains a url which returns the same random image based on the provided seed
$filePath= $faker->image(width: 800, height: 800, seed: '[email protected]');

// download a properly sized image from picsum into a file with a file path like '/tmp/13b73edae8443990be1aa8f1a483bc27.jpg'
$filePath= $faker->image(dir: '/tmp', width: 640, height: 480);

Also, there are some more options :

  • alternative webp format
  • effects (grayscale, blurry)
  • seeding ensures you can get the same photo each time by providing a seed string
  • returning a specific photo based on an id instead of a random one (ex: https://picsum.photos/id/1/800/600)

Testing

composer test

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
gsferro/filament-odometer-easy
gsferro/filament-stat-plus-easy
jeffersongoncalves/filament-barcode-field
martin6363/filament-sidebar-resize
graystackit/laravel-dymo-printer
phpinnacle/money
lastdragon-ru/lara-asp-documentator
tumutech/laravel-qr-code
babenkoivan/elastic-scout-driver-plus
socialiteproviders/apple
phpshko/laravel-livewire-depdrop
larasell-dev/larasell
calliostro/spotify-bundle
calmfox/watch-sylius
damienfern/grpc-symfony-bundle
atoolo/index-bundle
atoolo/genai-bundle
coprotoai/laravel-ticket
davidjln/llm-carbon-bundle
cryonighter/valid-request-bundle