-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from xefi/images-extension
✨ Image extension
- Loading branch information
Showing
4 changed files
with
36 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
title: Images | ||
description: Images extension for Xefi Faker PHP | ||
--- | ||
|
||
## Requirement | ||
|
||
This extension is not included with the base faker php package, you'll need to require it: | ||
|
||
```bash | ||
composer require --dev xefi/faker-php-images | ||
``` | ||
|
||
## Image | ||
|
||
Returns a [Image](https://github.com/Intervention/image/blob/develop/src/Image.php) object from the intervention/image package ([documentation](https://image.intervention.io/v3)). | ||
|
||
Example :  | ||
|
||
```php | ||
$faker->image(width: 1280, height: 720, backgroundColor: '#cccccc', textColor: '#333333', text: 'My Placeholder text'); | ||
|
||
// Examples for saving the image | ||
$image = $faker->image(); | ||
$image->toPng()->save('images/foo.png'); | ||
``` | ||
|
||
## Image URL | ||
|
||
```php | ||
$faker->imageUrl(width: 1280, height: 720); // https://placehold.co/1280x720 | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.