Download the PHP package naim886/imgenerate-laravel-faker without Composer
On this page you can find all versions of the php package naim886/imgenerate-laravel-faker. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download naim886/imgenerate-laravel-faker
More information about naim886/imgenerate-laravel-faker
Files in naim886/imgenerate-laravel-faker
Package imgenerate-laravel-faker
Short Description A Laravel package to generate fake images using imgenerate.com API for testing and development with full customization support
License MIT
Informations about the package imgenerate-laravel-faker
Laravel Imgenerate Faker
A Laravel package to generate fake images using imgenerate.com API for testing and development purposes. Perfect for seeding databases with realistic placeholder images.
Features
- 🎨 Generate fake images with custom dimensions
- 🎯 Multiple image categories (nature, people, technology, etc.)
- 💾 Save images directly to Laravel storage
- 🔗 Get image URLs for external use
- 🎭 Integrate seamlessly with Laravel Faker
- 🚀 Easy to use and configure
Installation
You can install the package via composer:
The package will automatically register itself.
Configuration
Optionally, you can publish the configuration file:
This will create a config/imgenerate.php file where you can customize default settings.
Usage
Basic Usage
Customization Parameters
The package supports full customization of generated images:
- width: Image width in pixels (e.g., 400, 800, 1920)
- height: Image height in pixels (e.g., 400, 600, 1080)
- bg: Background color as hex code without # (e.g., '1e3a8a', 'ff5733')
- text_color: Text color as hex code without # (e.g., 'ffffff', '000000')
- font_size: Font size for text (e.g., 12, 24, 48)
- angle: Text rotation angle in degrees 0-360 (e.g., 0, 45, 90)
- text: Custom text to display on image (e.g., 'Hello World', 'Product Name')
- format: Image format (e.g., 'jpg', 'png', 'webp')
Using Fluent Interface
Using with Laravel Faker
In your model factories:
Using the Faker Provider
Add the provider to your factory or test:
Save Images to Storage
Advanced Usage
Practical Examples
Configuration Options
You can also set these via environment variables in your .env file:
Example: Complete Model Factory
User Factory Example with Avatars
Example: Database Seeder
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
All versions of imgenerate-laravel-faker with dependencies
illuminate/support Version ^8.0|^9.0|^10.0|^11.0|^12.0
guzzlehttp/guzzle Version ^7.0