Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
uyab committed Aug 20, 2017
1 parent 538ac8d commit 6c5bbb3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ php artisan vendor:publish --provider="Laravolt\Avatar\ServiceProvider"
This will create config file located in `config/avatar.php` and a set of fonts located in `resources/laravolt/avatar/fonts`.

## Usage

### Output As Base64
```php
//this will output data-uri (base64 image data)
//something like data:image/png;base64,iVBORw0KGg....
Expand All @@ -46,12 +48,19 @@ Avatar::create('Joko Widodo')->toBase64();
//use in view
//this will display initials JW as an image
<img src="{{ Avatar::create('Joko Widodo')->toBase64() }}" />
```

//save to file
### Save As File
```php
Avatar::create('Susilo Bambang Yudhoyono')->save('sample.png');
Avatar::create('Susilo Bambang Yudhoyono')->save('sample.jpg', 100); // quality = 100
```

### Output As SVG
```php
Avatar::create('Susilo Bambang Yudhoyono')->toSvg();
```

## Get underlying Intervention image object
```php
Avatar::create('Abdul Somad')->getImageObject();
Expand Down

0 comments on commit 6c5bbb3

Please sign in to comment.