Generator
in package
Table of Contents
Properties
- $address : string
- $amPm : string
- $asciify : string
- $biasedNumberBetween : int
- $boolean : bool
- $bothify : string
- $buildingNumber : string
- $century : string
- $chrome : string
- $city : string
- $citySuffix : string
- $colorName : string
- $company : string
- $companyEmail : string
- $companySuffix : string
- $country : string
- $countryCode : string
- $countryISOAlpha3 : string
- $creditCardDetails : array<string|int, mixed>
- $creditCardExpirationDate : DateTime
- $creditCardExpirationDateString : string
- $creditCardNumber : string
- $creditCardType : string
- $currencyCode : string
- $date : string
- $dateTime : DateTime
- $dateTimeAD : DateTime
- $dateTimeBetween : DateTime
- $dateTimeInInterval : DateTime
- $dateTimeThisCentury : DateTime
- $dateTimeThisDecade : DateTime
- $dateTimeThisMonth : DateTime
- $dateTimeThisYear : DateTime
- $dayOfMonth : string
- $dayOfWeek : string
- $domainName : string
- $domainWord : string
- $e164PhoneNumber : string
- $email : string
- $emoji : string
- $file : string
- $firefox : string
- $firstName : string
- $firstNameFemale : string
- $firstNameMale : string
- $freeEmail : string
- $freeEmailDomain : string
- $getDefaultTimezone : string
- $hexColor : string
- $hslColor : string
- $hslColorAsArray : array<string|int, mixed>
- $iban : string
- $image : string
- $imageUrl : string
- $imei : int
- $internetExplorer : string
- $iosMobileToken : string
- $ipv4 : string
- $ipv6 : string
- $iso8601 : string
- $jobTitle : string
- $languageCode : string
- $lastName : string
- $latitude : float
- $lexify : string
- $linuxPlatformToken : string
- $linuxProcessor : string
- $localCoordinates : array<string|int, float>
- $locale : string
- $localIpv4 : string
- $longitude : float
- $macAddress : string
- $macPlatformToken : string
- $macProcessor : string
- $md5 : string
- $month : string
- $monthName : string
- $msedge : string
- $name : string
- $numerify : string
- $opera : string
- $paragraph : string
- $paragraphs : array<string|int, mixed>|string
- $passthrough : mixed
- $password : string
- $phoneNumber : string
- $postcode : string
- $randomAscii : string
- $randomDigitNotNull : int
- $randomElement : mixed
- $randomElements : array<string|int, mixed>
- $randomHtml : string
- $randomKey : int|string|null
- $randomLetter : string
- $realText : string
- $realTextBetween : string
- $regexify : string
- $rgbaCssColor : string
- $rgbColor : string
- $rgbColorAsArray : array<string|int, mixed>
- $rgbCssColor : string
- $safari : string
- $safeColorName : string
- $safeEmail : string
- $safeEmailDomain : string
- $safeHexColor : string
- $sentence : string
- $sentences : array<string|int, mixed>|string
- $setDefaultTimezone : void
- $sha1 : string
- $sha256 : string
- $shuffle : array<string|int, mixed>|string
- $shuffleArray : array<string|int, mixed>
- $shuffleString : string
- $slug : string
- $streetAddress : string
- $streetName : string
- $streetSuffix : string
- $swiftBicNumber : string
- $text : string
- $time : string
- $timezone : string
- $title : string
- $titleFemale : string
- $titleMale : string
- $tld : string
- $toLower : string
- $toUpper : string
- $unixTime : int
- $url : string
- $userAgent : string
- $userName : string
- $uuid : string
- $windowsPlatformToken : string
- $word : string
- $words : array<string|int, mixed>|string
- $year : string
- $formatters : mixed
- $providers : mixed
- $container : mixed
- $uniqueGenerator : UniqueGenerator
Methods
- __call() : mixed
- __construct() : mixed
- __destruct() : mixed
- __get() : mixed
- __wakeup() : mixed
- addProvider() : mixed
- address() : string
- amPm() : string
- asciify() : string
- biasedNumberBetween() : int
- bloodGroup() : string
- Get a full blood group
- bloodRh() : string
- Get a random resis value
- bloodType() : string
- Get an actual blood type
- boolean() : bool
- bothify() : string
- buildingNumber() : string
- century() : string
- chrome() : string
- city() : string
- citySuffix() : string
- colorName() : string
- company() : string
- companyEmail() : string
- companySuffix() : string
- country() : string
- countryCode() : string
- countryISOAlpha3() : string
- creditCardDetails() : array<string|int, mixed>
- creditCardExpirationDate() : DateTime
- creditCardExpirationDateString() : string
- creditCardNumber() : string
- creditCardType() : string
- currencyCode() : string
- date() : string
- dateTime() : DateTime
- dateTimeAD() : DateTime
- dateTimeBetween() : DateTime
- dateTimeInInterval() : DateTime
- dateTimeThisCentury() : DateTime
- dateTimeThisDecade() : DateTime
- dateTimeThisMonth() : DateTime
- dateTimeThisYear() : DateTime
- dayOfMonth() : string
- dayOfWeek() : string
- domainName() : string
- domainWord() : string
- e164PhoneNumber() : string
- ean13() : string
- Get a random EAN13 barcode.
- ean8() : string
- Get a random EAN8 barcode.
- email() : string
- emoji() : string
- ext() : T
- file() : string
- fileExtension() : mixed
- Get a random file extension (without a dot)
- filePath() : mixed
- Get a full path to a new real file on the system.
- firefox() : string
- firstName() : string
- firstNameFemale() : string
- firstNameMale() : string
- format() : mixed
- freeEmail() : string
- freeEmailDomain() : string
- getDefaultTimezone() : string
- getFormatter() : callable
- getProviders() : mixed
- hexColor() : string
- hslColor() : string
- hslColorAsArray() : array<string|int, mixed>
- iban() : string
- image() : string
- imageUrl() : string
- imei() : int
- internetExplorer() : string
- iosMobileToken() : string
- ipv4() : string
- ipv6() : string
- isbn10() : string
- Get a random ISBN-10 code
- isbn13() : string
- Get a random ISBN-13 code
- iso8601() : string
- jobTitle() : string
- languageCode() : string
- lastName() : string
- latitude() : float
- lexify() : string
- linuxPlatformToken() : string
- linuxProcessor() : string
- localCoordinates() : array<string|int, float>
- locale() : string
- localIpv4() : string
- longitude() : float
- macAddress() : string
- macPlatformToken() : string
- macProcessor() : string
- md5() : string
- mimeType() : mixed
- Get a random MIME type
- month() : string
- monthName() : string
- msedge() : string
- name() : string
- numberBetween() : int
- Returns a random number between $int1 and $int2 (any order)
- numerify() : string
- opera() : string
- optional() : self
- Get a value only some percentage of the time.
- paragraph() : string
- paragraphs() : array<string|int, mixed>|string
- parse() : string
- Replaces tokens ('{{ tokenName }}') with the result from the token method call
- passthrough() : mixed
- password() : string
- phoneNumber() : string
- postcode() : string
- randomAscii() : string
- randomDigit() : int
- Returns a random number between 0 and 9
- randomDigitNot() : int
- Generates a random digit, which cannot be $except
- randomDigitNotNull() : int
- randomDigitNotZero() : int
- Returns a random number between 1 and 9
- randomElement() : mixed
- randomElements() : array<string|int, mixed>
- randomFloat() : float
- Return a random float number
- randomHtml() : string
- randomKey() : int|string|null
- randomLetter() : string
- randomNumber() : int
- Returns a random integer with 0 to $nbDigits digits.
- realText() : string
- realTextBetween() : string
- regexify() : string
- rgbaCssColor() : string
- rgbColor() : string
- rgbColorAsArray() : array<string|int, mixed>
- rgbCssColor() : string
- safari() : string
- safeColorName() : string
- safeEmail() : string
- safeEmailDomain() : string
- safeHexColor() : string
- seed() : mixed
- semver() : string
- Get a version number in semantic versioning syntax 2.0.0. (https://semver.org/spec/v2.0.0.html)
- sentence() : string
- sentences() : array<string|int, mixed>|string
- setDefaultTimezone() : void
- sha1() : string
- sha256() : string
- shuffle() : array<string|int, mixed>|string
- shuffleArray() : array<string|int, mixed>
- shuffleString() : string
- slug() : string
- streetAddress() : string
- streetName() : string
- streetSuffix() : string
- swiftBicNumber() : string
- text() : string
- time() : string
- timezone() : string
- title() : string
- titleFemale() : string
- titleMale() : string
- tld() : string
- toLower() : string
- toUpper() : string
- unique() : self
- With the unique generator you are guaranteed to never get the same two values.
- unixTime() : int
- url() : string
- userAgent() : string
- userName() : string
- uuid() : string
- valid() : self
- To make sure the value meet some criteria, pass a callable that verifies the output. If the validator fails, the generator will try again.
- windowsPlatformToken() : string
- word() : string
- words() : array<string|int, mixed>|string
- year() : string
- callFormatWithMatches() : mixed
- mode() : int
Properties
$address
public
string
$address
$amPm
public
string
$amPm
$asciify
public
string
$asciify
$biasedNumberBetween
public
int
$biasedNumberBetween
$boolean
public
bool
$boolean
$bothify
public
string
$bothify
$buildingNumber
public
string
$buildingNumber
$century
public
string
$century
$chrome
public
string
$chrome
$city
public
string
$city
$citySuffix
public
string
$citySuffix
$colorName
public
string
$colorName
$company
public
string
$company
$companyEmail
public
string
$companyEmail
$companySuffix
public
string
$companySuffix
$country
public
string
$country
$countryCode
public
string
$countryCode
$countryISOAlpha3
public
string
$countryISOAlpha3
$creditCardDetails
public
array<string|int, mixed>
$creditCardDetails
$creditCardExpirationDate
public
DateTime
$creditCardExpirationDate
$creditCardExpirationDateString
public
string
$creditCardExpirationDateString
$creditCardNumber
public
string
$creditCardNumber
$creditCardType
public
string
$creditCardType
$currencyCode
public
string
$currencyCode
$date
public
string
$date
$dateTime
public
DateTime
$dateTime
$dateTimeAD
public
DateTime
$dateTimeAD
$dateTimeBetween
public
DateTime
$dateTimeBetween
$dateTimeInInterval
public
DateTime
$dateTimeInInterval
$dateTimeThisCentury
public
DateTime
$dateTimeThisCentury
$dateTimeThisDecade
public
DateTime
$dateTimeThisDecade
$dateTimeThisMonth
public
DateTime
$dateTimeThisMonth
$dateTimeThisYear
public
DateTime
$dateTimeThisYear
$dayOfMonth
public
string
$dayOfMonth
$dayOfWeek
public
string
$dayOfWeek
$domainName
public
string
$domainName
$domainWord
public
string
$domainWord
$e164PhoneNumber
public
string
$e164PhoneNumber
public
string
$email
$emoji
public
string
$emoji
$file
public
string
$file
$firefox
public
string
$firefox
$firstName
public
string
$firstName
$firstNameFemale
public
string
$firstNameFemale
$firstNameMale
public
string
$firstNameMale
$freeEmail
public
string
$freeEmail
$freeEmailDomain
public
string
$freeEmailDomain
$getDefaultTimezone
public
string
$getDefaultTimezone
$hexColor
public
string
$hexColor
$hslColor
public
string
$hslColor
$hslColorAsArray
public
array<string|int, mixed>
$hslColorAsArray
$iban
public
string
$iban
$image
public
string
$image
$imageUrl
public
string
$imageUrl
$imei
public
int
$imei
$internetExplorer
public
string
$internetExplorer
$iosMobileToken
public
string
$iosMobileToken
$ipv4
public
string
$ipv4
$ipv6
public
string
$ipv6
$iso8601
public
string
$iso8601
$jobTitle
public
string
$jobTitle
$languageCode
public
string
$languageCode
$lastName
public
string
$lastName
$latitude
public
float
$latitude
$lexify
public
string
$lexify
$linuxPlatformToken
public
string
$linuxPlatformToken
$linuxProcessor
public
string
$linuxProcessor
$localCoordinates
public
array<string|int, float>
$localCoordinates
$locale
public
string
$locale
$localIpv4
public
string
$localIpv4
$longitude
public
float
$longitude
$macAddress
public
string
$macAddress
$macPlatformToken
public
string
$macPlatformToken
$macProcessor
public
string
$macProcessor
$md5
public
string
$md5
$month
public
string
$month
$monthName
public
string
$monthName
$msedge
public
string
$msedge
$name
public
string
$name
$numerify
public
string
$numerify
$opera
public
string
$opera
$paragraph
public
string
$paragraph
$paragraphs
public
array<string|int, mixed>|string
$paragraphs
$passthrough
public
mixed
$passthrough
$password
public
string
$password
$phoneNumber
public
string
$phoneNumber
$postcode
public
string
$postcode
$randomAscii
public
string
$randomAscii
$randomDigitNotNull
public
int
$randomDigitNotNull
$randomElement
public
mixed
$randomElement
$randomElements
public
array<string|int, mixed>
$randomElements
$randomHtml
public
string
$randomHtml
$randomKey
public
int|string|null
$randomKey
$randomLetter
public
string
$randomLetter
$realText
public
string
$realText
$realTextBetween
public
string
$realTextBetween
$regexify
public
string
$regexify
$rgbaCssColor
public
string
$rgbaCssColor
$rgbColor
public
string
$rgbColor
$rgbColorAsArray
public
array<string|int, mixed>
$rgbColorAsArray
$rgbCssColor
public
string
$rgbCssColor
$safari
public
string
$safari
$safeColorName
public
string
$safeColorName
$safeEmail
public
string
$safeEmail
$safeEmailDomain
public
string
$safeEmailDomain
$safeHexColor
public
string
$safeHexColor
$sentence
public
string
$sentence
$sentences
public
array<string|int, mixed>|string
$sentences
$setDefaultTimezone
public
void
$setDefaultTimezone
$sha1
public
string
$sha1
$sha256
public
string
$sha256
$shuffle
public
array<string|int, mixed>|string
$shuffle
$shuffleArray
public
array<string|int, mixed>
$shuffleArray
$shuffleString
public
string
$shuffleString
$slug
public
string
$slug
$streetAddress
public
string
$streetAddress
$streetName
public
string
$streetName
$streetSuffix
public
string
$streetSuffix
$swiftBicNumber
public
string
$swiftBicNumber
$text
public
string
$text
$time
public
string
$time
$timezone
public
string
$timezone
$title
public
string
$title
$titleFemale
public
string
$titleFemale
$titleMale
public
string
$titleMale
$tld
public
string
$tld
$toLower
public
string
$toLower
$toUpper
public
string
$toUpper
$unixTime
public
int
$unixTime
$url
public
string
$url
$userAgent
public
string
$userAgent
$userName
public
string
$userName
$uuid
public
string
$uuid
$windowsPlatformToken
public
string
$windowsPlatformToken
$word
public
string
$word
$words
public
array<string|int, mixed>|string
$words
$year
public
string
$year
$formatters
protected
mixed
$formatters
= []
$providers
protected
mixed
$providers
= []
$container
private
mixed
$container
$uniqueGenerator
private
UniqueGenerator
$uniqueGenerator
Methods
__call()
public
__call(string $method, array<string|int, mixed> $attributes) : mixed
Parameters
- $method : string
- $attributes : array<string|int, mixed>
__construct()
public
__construct([ContainerInterface $container = null ]) : mixed
Parameters
- $container : ContainerInterface = null
__destruct()
public
__destruct() : mixed
__get()
public
__get(string $attribute) : mixed
Parameters
- $attribute : string
Tags
__wakeup()
public
__wakeup() : mixed
addProvider()
public
addProvider(mixed $provider) : mixed
Parameters
- $provider : mixed
address()
public
address() : string
Return values
stringamPm()
public
amPm([mixed $max = '\'now\'' ]) : string
Parameters
- $max : mixed = '\'now\''
Return values
stringasciify()
public
asciify([mixed $string = '\'****\'' ]) : string
Parameters
- $string : mixed = '\'****\''
Return values
stringbiasedNumberBetween()
public
biasedNumberBetween([mixed $min = 0 ][, mixed $max = 100 ][, mixed $function = '\'sqrt\'' ]) : int
Parameters
- $min : mixed = 0
- $max : mixed = 100
- $function : mixed = '\'sqrt\''
Return values
intbloodGroup()
Get a full blood group
public
bloodGroup() : string
Tags
Return values
stringbloodRh()
Get a random resis value
public
bloodRh() : string
Tags
Return values
stringbloodType()
Get an actual blood type
public
bloodType() : string
Tags
Return values
stringboolean()
public
boolean([mixed $chanceOfGettingTrue = 50 ]) : bool
Parameters
- $chanceOfGettingTrue : mixed = 50
Return values
boolbothify()
public
bothify([mixed $string = '\'## ??\'' ]) : string
Parameters
- $string : mixed = '\'## ??\''
Return values
stringbuildingNumber()
public
buildingNumber() : string
Return values
stringcentury()
public
century() : string
Return values
stringchrome()
public
chrome() : string
Return values
stringcity()
public
city() : string
Return values
stringcitySuffix()
public
citySuffix() : string
Return values
stringcolorName()
public
colorName() : string
Return values
stringcompany()
public
company() : string
Return values
stringcompanyEmail()
public
companyEmail() : string
Return values
stringcompanySuffix()
public
companySuffix() : string
Return values
stringcountry()
public
country() : string
Return values
stringcountryCode()
public
countryCode() : string
Return values
stringcountryISOAlpha3()
public
countryISOAlpha3() : string
Return values
stringcreditCardDetails()
public
creditCardDetails([mixed $valid = true ]) : array<string|int, mixed>
Parameters
- $valid : mixed = true
Return values
array<string|int, mixed>creditCardExpirationDate()
public
creditCardExpirationDate([mixed $valid = true ]) : DateTime
Parameters
- $valid : mixed = true
Return values
DateTimecreditCardExpirationDateString()
public
creditCardExpirationDateString([mixed $valid = true ][, mixed $expirationDateFormat = null ]) : string
Parameters
- $valid : mixed = true
- $expirationDateFormat : mixed = null
Return values
stringcreditCardNumber()
public
creditCardNumber([mixed $type = null ][, mixed $formatted = false ][, mixed $separator = '\'-\'' ]) : string
Parameters
- $type : mixed = null
- $formatted : mixed = false
- $separator : mixed = '\'-\''
Return values
stringcreditCardType()
public
creditCardType() : string
Return values
stringcurrencyCode()
public
currencyCode() : string
Return values
stringdate()
public
date([mixed $format = '\'Y-m-d\'' ][, mixed $max = '\'now\'' ]) : string
Parameters
- $format : mixed = '\'Y-m-d\''
- $max : mixed = '\'now\''
Return values
stringdateTime()
public
dateTime([mixed $max = '\'now\'' ][, mixed $timezone = null ]) : DateTime
Parameters
- $max : mixed = '\'now\''
- $timezone : mixed = null
Return values
DateTimedateTimeAD()
public
dateTimeAD([mixed $max = '\'now\'' ][, mixed $timezone = null ]) : DateTime
Parameters
- $max : mixed = '\'now\''
- $timezone : mixed = null
Return values
DateTimedateTimeBetween()
public
dateTimeBetween([mixed $startDate = '\'-30 years\'' ][, mixed $endDate = '\'now\'' ][, mixed $timezone = null ]) : DateTime
Parameters
- $startDate : mixed = '\'-30 years\''
- $endDate : mixed = '\'now\''
- $timezone : mixed = null
Return values
DateTimedateTimeInInterval()
public
dateTimeInInterval([mixed $date = '\'-30 years\'' ][, mixed $interval = '\'+5 days\'' ][, mixed $timezone = null ]) : DateTime
Parameters
- $date : mixed = '\'-30 years\''
- $interval : mixed = '\'+5 days\''
- $timezone : mixed = null
Return values
DateTimedateTimeThisCentury()
public
dateTimeThisCentury([mixed $max = '\'now\'' ][, mixed $timezone = null ]) : DateTime
Parameters
- $max : mixed = '\'now\''
- $timezone : mixed = null
Return values
DateTimedateTimeThisDecade()
public
dateTimeThisDecade([mixed $max = '\'now\'' ][, mixed $timezone = null ]) : DateTime
Parameters
- $max : mixed = '\'now\''
- $timezone : mixed = null
Return values
DateTimedateTimeThisMonth()
public
dateTimeThisMonth([mixed $max = '\'now\'' ][, mixed $timezone = null ]) : DateTime
Parameters
- $max : mixed = '\'now\''
- $timezone : mixed = null
Return values
DateTimedateTimeThisYear()
public
dateTimeThisYear([mixed $max = '\'now\'' ][, mixed $timezone = null ]) : DateTime
Parameters
- $max : mixed = '\'now\''
- $timezone : mixed = null
Return values
DateTimedayOfMonth()
public
dayOfMonth([mixed $max = '\'now\'' ]) : string
Parameters
- $max : mixed = '\'now\''
Return values
stringdayOfWeek()
public
dayOfWeek([mixed $max = '\'now\'' ]) : string
Parameters
- $max : mixed = '\'now\''
Return values
stringdomainName()
public
domainName() : string
Return values
stringdomainWord()
public
domainWord() : string
Return values
stringe164PhoneNumber()
public
e164PhoneNumber() : string
Return values
stringean13()
Get a random EAN13 barcode.
public
ean13() : string
Tags
Return values
stringean8()
Get a random EAN8 barcode.
public
ean8() : string
Tags
Return values
stringemail()
public
email() : string
Return values
stringemoji()
public
emoji() : string
Return values
stringext()
public
ext(T> $id) : T
Parameters
- $id : T>
Tags
Return values
Tfile()
public
file([mixed $sourceDirectory = '\'/tmp\'' ][, mixed $targetDirectory = '\'/tmp\'' ][, mixed $fullPath = true ]) : string
Parameters
- $sourceDirectory : mixed = '\'/tmp\''
- $targetDirectory : mixed = '\'/tmp\''
- $fullPath : mixed = true
Return values
stringfileExtension()
Get a random file extension (without a dot)
public
fileExtension() : mixed
Tags
filePath()
Get a full path to a new real file on the system.
public
filePath() : mixed
firefox()
public
firefox() : string
Return values
stringfirstName()
public
firstName([mixed $gender = null ]) : string
Parameters
- $gender : mixed = null
Return values
stringfirstNameFemale()
public
firstNameFemale() : string
Return values
stringfirstNameMale()
public
firstNameMale() : string
Return values
stringformat()
public
format(mixed $format[, mixed $arguments = [] ]) : mixed
Parameters
- $format : mixed
- $arguments : mixed = []
freeEmail()
public
freeEmail() : string
Return values
stringfreeEmailDomain()
public
freeEmailDomain() : string
Return values
stringgetDefaultTimezone()
public
getDefaultTimezone() : string
Return values
stringgetFormatter()
public
getFormatter(string $format) : callable
Parameters
- $format : string
Return values
callablegetProviders()
public
getProviders() : mixed
hexColor()
public
hexColor() : string
Return values
stringhslColor()
public
hslColor() : string
Return values
stringhslColorAsArray()
public
hslColorAsArray() : array<string|int, mixed>
Return values
array<string|int, mixed>iban()
public
iban([mixed $countryCode = null ][, mixed $prefix = '\'\'' ][, mixed $length = null ]) : string
Parameters
- $countryCode : mixed = null
- $prefix : mixed = '\'\''
- $length : mixed = null
Return values
stringimage()
public
image([mixed $dir = null ][, mixed $width = 640 ][, mixed $height = 480 ][, mixed $category = null ][, mixed $fullPath = true ][, mixed $randomize = true ][, mixed $word = null ][, mixed $gray = false ][, string $format = '\'png\'' ]) : string
Parameters
- $dir : mixed = null
- $width : mixed = 640
- $height : mixed = 480
- $category : mixed = null
- $fullPath : mixed = true
- $randomize : mixed = true
- $word : mixed = null
- $gray : mixed = false
- $format : string = '\'png\''
Return values
stringimageUrl()
public
imageUrl([mixed $width = 640 ][, mixed $height = 480 ][, mixed $category = null ][, mixed $randomize = true ][, mixed $word = null ][, mixed $gray = false ][, string $format = '\'png\'' ]) : string
Parameters
- $width : mixed = 640
- $height : mixed = 480
- $category : mixed = null
- $randomize : mixed = true
- $word : mixed = null
- $gray : mixed = false
- $format : string = '\'png\''
Return values
stringimei()
public
imei() : int
Return values
intinternetExplorer()
public
internetExplorer() : string
Return values
stringiosMobileToken()
public
iosMobileToken() : string
Return values
stringipv4()
public
ipv4() : string
Return values
stringipv6()
public
ipv6() : string
Return values
stringisbn10()
Get a random ISBN-10 code
public
isbn10() : string
Tags
Return values
stringisbn13()
Get a random ISBN-13 code
public
isbn13() : string
Tags
Return values
stringiso8601()
public
iso8601([mixed $max = '\'now\'' ]) : string
Parameters
- $max : mixed = '\'now\''
Return values
stringjobTitle()
public
jobTitle() : string
Return values
stringlanguageCode()
public
languageCode() : string
Return values
stringlastName()
public
lastName([mixed $gender = null ]) : string
Parameters
- $gender : mixed = null
Return values
stringlatitude()
public
latitude([mixed $min = -90 ][, mixed $max = 90 ]) : float
Parameters
- $min : mixed = -90
- $max : mixed = 90
Return values
floatlexify()
public
lexify([mixed $string = '\'????\'' ]) : string
Parameters
- $string : mixed = '\'????\''
Return values
stringlinuxPlatformToken()
public
linuxPlatformToken() : string
Return values
stringlinuxProcessor()
public
linuxProcessor() : string
Return values
stringlocalCoordinates()
public
localCoordinates() : array<string|int, float>
Return values
array<string|int, float>locale()
public
locale() : string
Return values
stringlocalIpv4()
public
localIpv4() : string
Return values
stringlongitude()
public
longitude([mixed $min = -180 ][, mixed $max = 180 ]) : float
Parameters
- $min : mixed = -180
- $max : mixed = 180
Return values
floatmacAddress()
public
macAddress() : string
Return values
stringmacPlatformToken()
public
macPlatformToken() : string
Return values
stringmacProcessor()
public
macProcessor() : string
Return values
stringmd5()
public
md5() : string
Return values
stringmimeType()
Get a random MIME type
public
mimeType() : mixed
Tags
month()
public
month([mixed $max = '\'now\'' ]) : string
Parameters
- $max : mixed = '\'now\''
Return values
stringmonthName()
public
monthName([mixed $max = '\'now\'' ]) : string
Parameters
- $max : mixed = '\'now\''
Return values
stringmsedge()
public
msedge() : string
Return values
stringname()
public
name([mixed $gender = null ]) : string
Parameters
- $gender : mixed = null
Return values
stringnumberBetween()
Returns a random number between $int1 and $int2 (any order)
public
numberBetween([mixed $int1 = 0 ][, mixed $int2 = 2147483647 ]) : int
Parameters
- $int1 : mixed = 0
- $int2 : mixed = 2147483647
Tags
Return values
intnumerify()
public
numerify([mixed $string = '\'###\'' ]) : string
Parameters
- $string : mixed = '\'###\''
Return values
stringopera()
public
opera() : string
Return values
stringoptional()
Get a value only some percentage of the time.
public
optional([float $weight = 0.5 ][, mixed $default = null ]) : self
Parameters
- $weight : float = 0.5
-
A probability between 0 and 1, 0 means that we always get the default value.
- $default : mixed = null
Return values
selfparagraph()
public
paragraph([mixed $nbSentences = 3 ][, mixed $variableNbSentences = true ]) : string
Parameters
- $nbSentences : mixed = 3
- $variableNbSentences : mixed = true
Return values
stringparagraphs()
public
paragraphs([mixed $nb = 3 ][, mixed $asText = false ]) : array<string|int, mixed>|string
Parameters
- $nb : mixed = 3
- $asText : mixed = false
Return values
array<string|int, mixed>|stringparse()
Replaces tokens ('{{ tokenName }}') with the result from the token method call
public
parse(string $string) : string
Parameters
- $string : string
-
String that needs to bet parsed
Return values
stringpassthrough()
public
passthrough([mixed $value = ]) : mixed
Parameters
- $value : mixed =
password()
public
password([mixed $minLength = 6 ][, mixed $maxLength = 20 ]) : string
Parameters
- $minLength : mixed = 6
- $maxLength : mixed = 20
Return values
stringphoneNumber()
public
phoneNumber() : string
Return values
stringpostcode()
public
postcode() : string
Return values
stringrandomAscii()
public
randomAscii() : string
Return values
stringrandomDigit()
Returns a random number between 0 and 9
public
randomDigit() : int
Return values
intrandomDigitNot()
Generates a random digit, which cannot be $except
public
randomDigitNot(mixed $except) : int
Parameters
- $except : mixed
Return values
intrandomDigitNotNull()
public
randomDigitNotNull() : int
Return values
intrandomDigitNotZero()
Returns a random number between 1 and 9
public
randomDigitNotZero() : int
Return values
intrandomElement()
public
randomElement([mixed $array = ['\'a\'', '\'b\'', '\'c\''] ]) : mixed
Parameters
- $array : mixed = ['\'a\'', '\'b\'', '\'c\'']
randomElements()
public
randomElements([mixed $array = ['\'a\'', '\'b\'', '\'c\''] ][, mixed $count = 1 ][, mixed $allowDuplicates = false ]) : array<string|int, mixed>
Parameters
- $array : mixed = ['\'a\'', '\'b\'', '\'c\'']
- $count : mixed = 1
- $allowDuplicates : mixed = false
Return values
array<string|int, mixed>randomFloat()
Return a random float number
public
randomFloat([mixed $nbMaxDecimals = null ][, mixed $min = 0 ][, mixed $max = null ]) : float
Parameters
- $nbMaxDecimals : mixed = null
- $min : mixed = 0
- $max : mixed = null
Tags
Return values
floatrandomHtml()
public
randomHtml([mixed $maxDepth = 4 ][, mixed $maxWidth = 4 ]) : string
Parameters
- $maxDepth : mixed = 4
- $maxWidth : mixed = 4
Return values
stringrandomKey()
public
randomKey([mixed $array = [] ]) : int|string|null
Parameters
- $array : mixed = []
Return values
int|string|nullrandomLetter()
public
randomLetter() : string
Return values
stringrandomNumber()
Returns a random integer with 0 to $nbDigits digits.
public
randomNumber([int|null $nbDigits = null ][, bool $strict = false ]) : int
The maximum value returned is mt_getrandmax()
Parameters
- $nbDigits : int|null = null
-
Defaults to a random number between 1 and 9
- $strict : bool = false
-
Whether the returned number should have exactly $nbDigits
Tags
Return values
intrealText()
public
realText([mixed $maxNbChars = 200 ][, mixed $indexSize = 2 ]) : string
Parameters
- $maxNbChars : mixed = 200
- $indexSize : mixed = 2
Return values
stringrealTextBetween()
public
realTextBetween([mixed $minNbChars = 160 ][, mixed $maxNbChars = 200 ][, mixed $indexSize = 2 ]) : string
Parameters
- $minNbChars : mixed = 160
- $maxNbChars : mixed = 200
- $indexSize : mixed = 2
Return values
stringregexify()
public
regexify([mixed $regex = '\'\'' ]) : string
Parameters
- $regex : mixed = '\'\''
Return values
stringrgbaCssColor()
public
rgbaCssColor() : string
Return values
stringrgbColor()
public
rgbColor() : string
Return values
stringrgbColorAsArray()
public
rgbColorAsArray() : array<string|int, mixed>
Return values
array<string|int, mixed>rgbCssColor()
public
rgbCssColor() : string
Return values
stringsafari()
public
safari() : string
Return values
stringsafeColorName()
public
safeColorName() : string
Return values
stringsafeEmail()
public
safeEmail() : string
Return values
stringsafeEmailDomain()
public
safeEmailDomain() : string
Return values
stringsafeHexColor()
public
safeHexColor() : string
Return values
stringseed()
public
seed([mixed $seed = null ]) : mixed
Parameters
- $seed : mixed = null
semver()
Get a version number in semantic versioning syntax 2.0.0. (https://semver.org/spec/v2.0.0.html)
public
semver([bool $preRelease = false ][, bool $build = false ]) : string
Parameters
- $preRelease : bool = false
-
Pre release parts may be randomly included
- $build : bool = false
-
Build parts may be randomly included
Tags
Return values
stringsentence()
public
sentence([mixed $nbWords = 6 ][, mixed $variableNbWords = true ]) : string
Parameters
- $nbWords : mixed = 6
- $variableNbWords : mixed = true
Return values
stringsentences()
public
sentences([mixed $nb = 3 ][, mixed $asText = false ]) : array<string|int, mixed>|string
Parameters
- $nb : mixed = 3
- $asText : mixed = false
Return values
array<string|int, mixed>|stringsetDefaultTimezone()
public
setDefaultTimezone([mixed $timezone = null ]) : void
Parameters
- $timezone : mixed = null
sha1()
public
sha1() : string
Return values
stringsha256()
public
sha256() : string
Return values
stringshuffle()
public
shuffle([mixed $arg = '\'\'' ]) : array<string|int, mixed>|string
Parameters
- $arg : mixed = '\'\''
Return values
array<string|int, mixed>|stringshuffleArray()
public
shuffleArray([mixed $array = [] ]) : array<string|int, mixed>
Parameters
- $array : mixed = []
Return values
array<string|int, mixed>shuffleString()
public
shuffleString([mixed $string = '\'\'' ][, mixed $encoding = '\'UTF-8\'' ]) : string
Parameters
- $string : mixed = '\'\''
- $encoding : mixed = '\'UTF-8\''
Return values
stringslug()
public
slug([mixed $nbWords = 6 ][, mixed $variableNbWords = true ]) : string
Parameters
- $nbWords : mixed = 6
- $variableNbWords : mixed = true
Return values
stringstreetAddress()
public
streetAddress() : string
Return values
stringstreetName()
public
streetName() : string
Return values
stringstreetSuffix()
public
streetSuffix() : string
Return values
stringswiftBicNumber()
public
swiftBicNumber() : string
Return values
stringtext()
public
text([mixed $maxNbChars = 200 ]) : string
Parameters
- $maxNbChars : mixed = 200
Return values
stringtime()
public
time([mixed $format = '\'H:i:s\'' ][, mixed $max = '\'now\'' ]) : string
Parameters
- $format : mixed = '\'H:i:s\''
- $max : mixed = '\'now\''
Return values
stringtimezone()
public
timezone([mixed $countryCode = null ]) : string
Parameters
- $countryCode : mixed = null
Return values
stringtitle()
public
title([mixed $gender = null ]) : string
Parameters
- $gender : mixed = null
Return values
stringtitleFemale()
public
titleFemale() : string
Return values
stringtitleMale()
public
titleMale() : string
Return values
stringtld()
public
tld() : string
Return values
stringtoLower()
public
toLower([mixed $string = '\'\'' ]) : string
Parameters
- $string : mixed = '\'\''
Return values
stringtoUpper()
public
toUpper([mixed $string = '\'\'' ]) : string
Parameters
- $string : mixed = '\'\''
Return values
stringunique()
With the unique generator you are guaranteed to never get the same two values.
public
unique([bool $reset = false ][, int $maxRetries = 10000 ]) : self
// will never return twice the same value
$faker->unique()->randomElement(array(1, 2, 3));
Parameters
- $reset : bool = false
-
If set to true, resets the list of existing values
- $maxRetries : int = 10000
-
Maximum number of retries to find a unique value, After which an OverflowException is thrown.
Tags
Return values
self —A proxy class returning only non-existing values
unixTime()
public
unixTime([mixed $max = '\'now\'' ]) : int
Parameters
- $max : mixed = '\'now\''
Return values
inturl()
public
url() : string
Return values
stringuserAgent()
public
userAgent() : string
Return values
stringuserName()
public
userName() : string
Return values
stringuuid()
public
uuid() : string
Return values
stringvalid()
To make sure the value meet some criteria, pass a callable that verifies the output. If the validator fails, the generator will try again.
public
valid([Closure|null $validator = null ][, int $maxRetries = 10000 ]) : self
The value validity is determined by a function passed as first argument.
$values = array();
$evenValidator = function ($digit) {
return $digit % 2 === 0;
};
for ($i=0; $i < 10; $i++) {
$values []= $faker->valid($evenValidator)->randomDigit;
}
print_r($values); // [0, 4, 8, 4, 2, 6, 0, 8, 8, 6]
Parameters
- $validator : Closure|null = null
-
A function returning true for valid values
- $maxRetries : int = 10000
-
Maximum number of retries to find a valid value, After which an OverflowException is thrown.
Tags
Return values
self —A proxy class returning only valid values
windowsPlatformToken()
public
windowsPlatformToken() : string
Return values
stringword()
public
word() : string
Return values
stringwords()
public
words([mixed $nb = 3 ][, mixed $asText = false ]) : array<string|int, mixed>|string
Parameters
- $nb : mixed = 3
- $asText : mixed = false
Return values
array<string|int, mixed>|stringyear()
public
year([mixed $max = '\'now\'' ]) : string
Parameters
- $max : mixed = '\'now\''
Return values
stringcallFormatWithMatches()
protected
callFormatWithMatches(mixed $matches) : mixed
Parameters
- $matches : mixed
Tags
mode()
private
static mode() : int