PHP Class Laravolt\Avatar\Avatar

Show file Open project: laravolt/avatar Class Usage Examples

Protected Properties

Property Type Description
$ascii
$availableBackgrounds
$availableForegrounds
$background
$borderColor
$borderSize
$cache
$chars
$defaultFont
$font
$fontFolder
$fontSize
$fonts
$foreground
$height
$image
$initialGenerator
$initials
$name
$shape
$width

Public Methods

Method Description
__construct ( array $config, Illuminate\Cache\CacheManager $cache, Laravolt\Avatar\InitialGenerator $initialGenerator ) Avatar constructor.
__toString ( ) : String
create ( $name )
getImageObject ( )
getInitial ( )
save ( $path, $quality = 90 )
setBackground ( $hex )
setBorder ( $size, $color )
setDimension ( $width, $height = null )
setFont ( $font )
setFontFolder ( $folders )
setFontSize ( $size )
setForeground ( $hex )
setShape ( $shape )
toBase64 ( )

Protected Methods

Method Description
buildAvatar ( )
cacheKey ( )
chooseFont ( )
createCircleShape ( )
createShape ( )
createSquareShape ( )
getBorderColor ( )
getRandomBackground ( )
getRandomElement ( $array, $default )
getRandomForeground ( )
setRandomFont ( )

Method Details

__construct() public method

Avatar constructor.
public __construct ( array $config, Illuminate\Cache\CacheManager $cache, Laravolt\Avatar\InitialGenerator $initialGenerator )
$config array
$cache Illuminate\Cache\CacheManager
$initialGenerator Laravolt\Avatar\InitialGenerator

__toString() public method

public __toString ( ) : String
return String

buildAvatar() protected method

protected buildAvatar ( )

cacheKey() protected method

protected cacheKey ( )

chooseFont() protected method

protected chooseFont ( )

create() public method

public create ( $name )

createCircleShape() protected method

protected createCircleShape ( )

createShape() protected method

protected createShape ( )

createSquareShape() protected method

protected createSquareShape ( )

getBorderColor() protected method

protected getBorderColor ( )

getImageObject() public method

public getImageObject ( )

getInitial() public method

public getInitial ( )

getRandomBackground() protected method

protected getRandomBackground ( )

getRandomElement() protected method

protected getRandomElement ( $array, $default )

getRandomForeground() protected method

protected getRandomForeground ( )

save() public method

public save ( $path, $quality = 90 )

setBackground() public method

public setBackground ( $hex )

setBorder() public method

public setBorder ( $size, $color )

setDimension() public method

public setDimension ( $width, $height = null )

setFont() public method

public setFont ( $font )

setFontFolder() public method

public setFontFolder ( $folders )

setFontSize() public method

public setFontSize ( $size )

setForeground() public method

public setForeground ( $hex )

setRandomFont() protected method

protected setRandomFont ( )

setShape() public method

public setShape ( $shape )

toBase64() public method

public toBase64 ( )

Property Details

$ascii protected property

protected $ascii

$availableBackgrounds protected property

protected $availableBackgrounds

$availableForegrounds protected property

protected $availableForegrounds

$background protected property

protected $background

$borderColor protected property

protected $borderColor

$borderSize protected property

protected $borderSize

$cache protected property

protected $cache

$chars protected property

protected $chars

$defaultFont protected property

protected $defaultFont

$font protected property

protected $font

$fontFolder protected property

protected $fontFolder

$fontSize protected property

protected $fontSize

$fonts protected property

protected $fonts

$foreground protected property

protected $foreground

$height protected property

protected $height

$image protected property

protected $image

$initialGenerator protected property

protected $initialGenerator

$initials protected property

protected $initials

$name protected property

protected $name

$shape protected property

protected $shape

$width protected property

protected $width