Plentymarkets interface documentation

Console

Commands

GenerateShopBuilderPresetsEvent

Event

Namespace

Plenty\Console\Commands

Methods
public getPluginSet():Plenty\Modules\Plugin\PluginSet\Models\PluginSet
Return type: PluginSet

Get the plugin set which have been built

Http

Events

CsrfTokenMismatch

The event is triggered after an invalird csrf token is send with an request.

Namespace

Plenty\Http\Events

Models

Item

ItemImageSettings

Configuration of item images

Namespace

Plenty\Legacy\Models\Item

Properties
Name Type Description

cdnUrl

int

maxAge

int

imageExportPos

int

defaultExport

int

ftpImport

int

ftpImportMatching

int

neckermannExport

int

attributeImageWidth

int

attributeImageHeight

int

name

array

placeholder

array

sizes

array

aliases

array

legacyPreviousSizes

array

Methods
public toArray()

Returns this model as an array.

Item

SalesPrice

SalesPriceSearchRepository

foo

Namespace

Plenty\Legacy\Repositories\Item\SalesPrice

Methods
Return type: SalesPriceSearchResponse
Parameters

Name

Type

Description

$request

SalesPriceSearchRequest

public searchAll($request):array
Parameters

Name

Type

Description

$request

SalesPriceSearchRequest

Variation

DetectSalesPriceService

To be written…​

Namespace

Plenty\Legacy\Services\Item\Variation

Methods
public getQuantity():void
public setQuantity($quantity):Plenty\Legacy\Services\Item\Variation\DetectSalesPriceService
Return type: DetectSalesPriceService
Parameters

Name

Type

Description

$quantity

public getCurrency():void
public setCurrency($currency):Plenty\Legacy\Services\Item\Variation\DetectSalesPriceService
Return type: DetectSalesPriceService
Parameters

Name

Type

Description

$currency

public getPlentyId():void
public setPlentyId($plentyId):Plenty\Legacy\Services\Item\Variation\DetectSalesPriceService
Return type: DetectSalesPriceService
Parameters

Name

Type

Description

$plentyId

public getOrderReferrer():void
public setOrderReferrer($orderReferrer):Plenty\Legacy\Services\Item\Variation\DetectSalesPriceService
Return type: DetectSalesPriceService
Parameters

Name

Type

Description

$orderReferrer

public getCustomerClass():void
public setCustomerClass($customerClass):Plenty\Legacy\Services\Item\Variation\DetectSalesPriceService
Return type: DetectSalesPriceService
Parameters

Name

Type

Description

$customerClass

public getType():void
public setType($type):Plenty\Legacy\Services\Item\Variation\DetectSalesPriceService
Return type: DetectSalesPriceService
Parameters

Name

Type

Description

$type

public getCountryOfDelivery():void
public setCountryOfDelivery($countryOfDelivery):Plenty\Legacy\Services\Item\Variation\DetectSalesPriceService
Return type: DetectSalesPriceService
Parameters

Name

Type

Description

$countryOfDelivery

public getAccountType():void
public setAccountType($accountType):Plenty\Legacy\Services\Item\Variation\DetectSalesPriceService
Return type: DetectSalesPriceService
Parameters

Name

Type

Description

$accountType

public getAccountId():void
public setAccountId($accountId):Plenty\Legacy\Services\Item\Variation\DetectSalesPriceService
Return type: DetectSalesPriceService
Parameters

Name

Type

Description

$accountId

public detect():void

SalesPriceService

To be written…​

Namespace

Plenty\Legacy\Services\Item\Variation

Methods
public getUnitPrice($lot, $price, $unit):array
Parameters

Name

Type

Description

$lot

float

$price

float

$unit

string

Log

Contracts

LoggerContract

The contract for the logger.

Namespace

Plenty\Log\Contracts

Methods
public report($code, $additionalInfo = null):void

Report information.

Parameters

Name

Type

Description

$code

string

$additionalInfo

public debug($code, $additionalInfo = null):void

Detailed debug information.

Parameters

Name

Type

Description

$code

string

$additionalInfo

public info($code, $additionalInfo = null):void

Interesting events.

Parameters

Name

Type

Description

$code

string

$additionalInfo

public notice($code, $additionalInfo = null):void

Normal but significant events.

Parameters

Name

Type

Description

$code

string

$additionalInfo

public warning($code, $additionalInfo = null):void

Exceptional occurrences that are not errors.

Parameters

Name

Type

Description

$code

string

$additionalInfo

public error($code, $additionalInfo = null):void

Runtime errors that do not require immediate action but should typically be logged and monitored.

Parameters

Name

Type

Description

$code

string

$additionalInfo

public critical($code, $additionalInfo = null):void

Critical conditions.

Parameters

Name

Type

Description

$code

string

$additionalInfo

public alert($code, $additionalInfo = null):void

Action must be taken immediately.

Parameters

Name

Type

Description

$code

string

$additionalInfo

public emergency($code, $additionalInfo = null):void

System is unusable.

Parameters

Name

Type

Description

$code

$additionalInfo

public logException($exception, $traceDepth = 3):void

Log exceptions.

Parameters

Name

Type

Description

$exception

$traceDepth

int

The depth of the stack trace to be logged. Default is 3.

public setReferenceType($referenceType):Plenty\Log\Contracts\LoggerContract
Return type: LoggerContract

The reference type.

Parameters

Name

Type

Description

$referenceType

string

public setReferenceValue($referenceValue):Plenty\Log\Contracts\LoggerContract
Return type: LoggerContract

The reference value.

Parameters

Name

Type

Description

$referenceValue

public addReference($referenceType, $referenceValue):Plenty\Log\Contracts\LoggerContract
Return type: LoggerContract

Add reference.

Parameters

Name

Type

Description

$referenceType

string

$referenceValue

int

public addPlaceholder($placeholderName, $placeholderValue):Plenty\Log\Contracts\LoggerContract
Return type: LoggerContract

Add code placeholder.

Parameters

Name

Type

Description

$placeholderName

string

$placeholderValue

Exceptions

ReferenceTypeException

Class ReferenceTypeException

Namespace

Plenty\Log\Exceptions

Methods
public __construct($message, $code, $previous = null):void
Parameters

Name

Type

Description

$message

string

$code

int

$previous

Models

Log

The log entity model

Namespace

Plenty\Log\Models

Properties
Name Type Description

id

string

The ID of the log entry

createdAt

string

The date when the log entry was created

integration

string

The integration key used for the log entry. Used as a first level allocation.

identifier

string

The identifier used for the log entry. Used as a second level allocation.

code

string

The code for this current log entry. For log entries with level "debug", "info", "notice", "warning" and "report" this needs to have an translation in order to be stored.

referenceType

string

Deprecated field, see the <code>references</code> field instead.

referenceValue

Deprecated field, see the <code>references</code> field instead.

level

string

The level this current log entry belongs to. Notice! When storing log entries with level "report" the entries will actually be stored as level "info". The difference between "report" and "info" is that log entries with level "report" do not need prior activation.

additionalInfo

Additional information that need to also be stored. Can be an int, string or object.

callerFunction

string

callerLine

int

references

array

All the reference types and values correlated with this log entry.

Methods
public toArray()

Returns this model as an array.

Services

ReferenceContainer

Register log reference types.

Namespace

Plenty\Log\Services

Methods
public add($referenceTypes):void

Use this method to add reference types.

Parameters

Name

Type

Description

$referenceTypes

array

Contracts

LogRepositoryContract

Contract for logs.

Namespace

Plenty\Log\Search\Contracts

Methods
Return type: FilteredPaginatedResult

Search logs with the given filters.

Parameters

Name

Type

Description

$page

int

$itemsPerPage

int

$filters

array

$sortBy

string

$sortOrder

string

$with

array

public get($id):Plenty\Log\Models\Log
Return type: Log

Get log entry by id.

Parameters

Name

Type

Description

$id

Plenty

Plugin

Application

The main application

Namespace

Plenty\Plugin

Methods
public register($providerClassName):void

Register a service provider with the application.

Parameters

Name

Type

Description

$providerClassName

string

the classname with namespace of the provider

public bind($abstract, $concrete = null, $shared = false):void

Register a binding with the container.

Parameters

Name

Type

Description

$abstract

string

$concrete

string

$shared

bool

public singleton($abstract, $concrete = null):void

Register a shared binding in the container.

Parameters

Name

Type

Description

$abstract

string

$concrete

string

public make($abstract, $parameters = []):void
Parameters

Name

Type

Description

$abstract

string

$parameters

array

public makeWith($abstract, $parameters = []):void
Parameters

Name

Type

Description

$abstract

string

$parameters

array

public abort($code, $message = &quot;&quot;, $headers = []):void

Throw an HttpException with the given data.

Parameters

Name

Type

Description

$code

int

$message

string

$headers

array

public getWebstoreId():int

Returns current webstoreId

public getPlentyId():int
public isAdminPreview():bool
public isTemplateSafeMode():bool
public isBackendRequest():bool
public getPluginSetId():int
public getUrlPath($pluginName = &quot;&quot;):string

Returns the URL to the plugin resources

Parameters

Name

Type

Description

$pluginName

string

public getCdnDomain():string

Returns the URL from the cdn

public getPlentyHash():string

Returns the plentyHash

CachingRepository

caching repository

Namespace

Plenty\Plugin

Methods
public has($key):bool

Determine if an item exists in the cache.

Parameters

Name

Type

Description

$key

string

public get($key, $default = null):void

Retrieve an item from the cache by key.

Parameters

Name

Type

Description

$key

string

$default

public many($keys):array

Retrieve multiple items from the cache by key.

Parameters

Name

Type

Description

$keys

array

public pull($key, $default = null):void

Retrieve an item from the cache and delete it.

Parameters

Name

Type

Description

$key

string

$default

public put($key, $value, $minutes = null):void

Store an item in the cache.

Parameters

Name

Type

Description

$key

string

$value

$minutes

int

public putMany($values, $minutes):void

Store multiple items in the cache for a given number of minutes.

Parameters

Name

Type

Description

$values

array

$minutes

int

public add($key, $value, $minutes):bool

Store an item in the cache if the key does not exist.

Parameters

Name

Type

Description

$key

string

$value

$minutes

int

public remember($key, $minutes, $callback):void

Get an item from the cache, or store the default value.

Parameters

Name

Type

Description

$key

string

$minutes

int

$callback

callable

public forget($key):bool

Remove an item from the cache.

Parameters

Name

Type

Description

$key

string

public deleteByPrefix($prefix):void
Parameters

Name

Type

Description

$prefix

string

public static getPrefix():string

ConfigRepository

configuration repository

Namespace

Plenty\Plugin

Methods
public has($key):bool

Determine if the given configuration value exists.

Parameters

Name

Type

Description

$key

string

public get($key, $default = null):mixed

Get the specified configuration value.

Parameters

Name

Type

Description

$key

string

$default

public set($key, $value = null):void

Set a given configuration value.

Parameters

Name

Type

Description

$key

string

$value

public prepend($key, $value):void

Prepend a value onto an array configuration value.

Parameters

Name

Type

Description

$key

string

$value

public push($key, $value):void

Push a value onto an array configuration value.

Parameters

Name

Type

Description

$key

string

$value

public static getPrefix():string

Controller

Controller

Namespace

Plenty\Plugin

Methods
public __construct():void

Controller constructor.

DataExchangeServiceProvider

Data Exchange service provider

Namespace

Plenty\Plugin

Methods
public getApplication():Plenty\Plugin\Application
Return type: Application
public getEventDispatcher():Plenty\Plugin\Events\Dispatcher
Return type: Dispatcher

Middleware

Middleware

Namespace

Plenty\Plugin

Methods
public before($request):void
Parameters

Name

Type

Description

$request

Request

public after($request, $response):Plenty\Plugin\Http\Response
Return type: Response
Parameters

Name

Type

Description

$request

Request

$response

Response

RouteServiceProvider

Route service provider

Namespace

Plenty\Plugin

Methods
public getApplication():Plenty\Plugin\Application
Return type: Application
public getEventDispatcher():Plenty\Plugin\Events\Dispatcher
Return type: Dispatcher

ServiceProvider

Service provider for plugins

Namespace

Plenty\Plugin

Methods
public addGlobalMiddleware($middleware):void

Add a new middleware to end of the stack if it does not already exist.

Parameters

Name

Type

Description

$middleware

string

public getApplication():Plenty\Plugin\Application
Return type: Application
public getEventDispatcher():Plenty\Plugin\Events\Dispatcher
Return type: Dispatcher

SessionRepository

session repository

Namespace

Plenty\Plugin

Methods
public has($key):bool

Determine if the given session value exists.

Parameters

Name

Type

Description

$key

string

public get($key, $default = null):void

Get the specified session value.

Parameters

Name

Type

Description

$key

string

$default

public set($key, $value = null):void

Set a given session value.

Parameters

Name

Type

Description

$key

string

$value

public prepend($key, $value):void

Prepend a value onto an array session value.

Parameters

Name

Type

Description

$key

string

$value

public push($key, $value):void

Push a value onto an array session value.

Parameters

Name

Type

Description

$key

string

$value

public static getPrefix():string

Validation

DummyAttribute

Dummy Attribute Class

Namespace

Plenty\Validation

Methods
public getAttributeName():string

Returns the attribute's name

public setAttributeName($attributeName):Plenty\Validation\DummyAttribute
Return type: DummyAttribute

Sets the attribute's name

Parameters

Name

Type

Description

$attributeName

string

public accepted():Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must be yes, on, 1, or true. This is useful for validating "Terms of Service" acceptance.

public activeUrl():Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must be a valid URL according to the checkdnsrr PHP function.

public dateAfter($fieldNameOrTimeStr):Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must be a value after a given date. The dates will be passed into the strtotime PHP function.

Parameters

Name

Type

Description

$fieldNameOrTimeStr

string

public alphabetic():Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must be entirely alphabetic characters.

public alphaDash():Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation may have alpha-numeric characters, as well as dashes and underscores.

public alphaNum():Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must be entirely alpha-numeric characters.

public isArray():Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must be a PHP array.

public dateBefore($fieldNameOrTimeStr):Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must be a value preceding the given date. The dates will be passed into the PHP strtotime function.

Parameters

Name

Type

Description

$fieldNameOrTimeStr

string

public between($min, $max):Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must have a size between the given min and max. Strings, numerics, and files are evaluated in the same fashion as the size rule.

Parameters

Name

Type

Description

$min

int

$max

int

public boolean():Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must be able to be cast as a boolean. Accepted input are true, false, 1, 0, "1", and "0".

public confirmed():Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must have a matching field of foo_confirmation. For example, if the field under validation is password, a matching password_confirmation field must be present in the input.

public date():Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must be a valid date according to the strtotime PHP function.

public present():Plenty\Validation\DummyAttribute
Return type: DummyAttribute

Validate that an attribute exists even if not filled.

public dateFormat($format):Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must match the given format. The format will be evaluated using the PHP date_parse_from_format function.

Parameters

Name

Type

Description

$format

string

public different($fieldName):Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must have a different value than field.

Parameters

Name

Type

Description

$fieldName

string

public digits($count):Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must be numeric and must have an exact length of $count.

Parameters

Name

Type

Description

$count

int

public digitsBetween($min, $max):Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must have a length between the given min and max.

Parameters

Name

Type

Description

$min

int

$max

int

public email():Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must be formatted as an e-mail address.

public exists($table, $columns = []):Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must exist on a given database table.

Parameters

Name

Type

Description

$table

string

$columns

array

public image():Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The file under validation must be an image (jpeg, png, bmp, gif, or svg)

public in($values):Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must be included in the given list of values.

Parameters

Name

Type

Description

$values

array

public integer():Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must be an integer.

public ip():Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must be an IP address.

public json():Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must a valid JSON string.

public max($value):Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must be less than or equal to a maximum value. Strings, numerics, and files are evaluated in the same fashion as the size rule.

Parameters

Name

Type

Description

$value

int

public mimeTypes($types):Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The file under validation must have a MIME type corresponding to one of the listed extensions.

Parameters

Name

Type

Description

$types

array

public min($value):Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must have a minimum value. Strings, numerics, and files are evaluated in the same fashion as the size rule.

Parameters

Name

Type

Description

$value

int

public notIn($values):Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must not be included in the given list of values.

Parameters

Name

Type

Description

$values

public numeric():Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must be numeric.

public regex($pattern):Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must match the given regular expression.

Parameters

Name

Type

Description

$pattern

string

public required():Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must be present in the input data and not empty. A field is considered "empty" is one of the following conditions are true: The value is null.

public requiredIf($fieldName, $value):Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must be present if the anotherfield field is equal to any value.

Parameters

Name

Type

Description

$fieldName

string

$value

public requiredUnless($fieldName, $value):Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must be present unless the anotherfield field is equal to any value.

Parameters

Name

Type

Description

$fieldName

string

$value

string

public requiredWith($fieldNames):Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must be present only if any of the other specified fields are present.

Parameters

Name

Type

Description

$fieldNames

array

public requiredWithAll($fieldNames):Plenty\Validation\DummyAttribute
Return type: DummyAttribute

required_with_all

Parameters

Name

Type

Description

$fieldNames

array

public requiredWithout($fieldNames):Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must be present only when any of the other specified fields are not present.

Parameters

Name

Type

Description

$fieldNames

array

public requiredWithoutAll($fieldNames):Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must be present only when all of the other specified fields are not present.

Parameters

Name

Type

Description

$fieldNames

array

public notLike($fieldName):Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must be not like the specified name.

Parameters

Name

Type

Description

$fieldName

string

public same($fieldName):Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The given field must match the field under validation.

Parameters

Name

Type

Description

$fieldName

string

public size($value):Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must have a size matching the given value. For string data, value corresponds to the number of characters.

Parameters

Name

Type

Description

$value

int

public string():Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must be a string.

public timezone():Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must be a valid timezone identifier according to the timezone_identifiers_list PHP function.

public unique($table, $column, $except = null, $idColumn = null):Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must be unique on a given database table. If the column option is not specified, the field name will be used.

Parameters

Name

Type

Description

$table

string

$column

string

$except

string

$idColumn

string

public url():Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must be a valid URL according to PHP's filter_var function.

public sometimes():Plenty\Validation\DummyAttribute
Return type: DummyAttribute

In some situations, you may wish to run validation checks against a field only if that field is present in the input array. To quickly accomplish this, add the sometimes rule.

public nullable():Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation may be null. This is particularly useful when validating primitive such as strings and integers that can contain null values.

public generateRulesContent():void

Returns all rules connected to the attribute

public dateW3C($allowTimestamps = false):Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must be a valid w3c formated date time string.

Parameters

Name

Type

Description

$allowTimestamps

bool

Allow timestamps as a valid format as well.

public inTimestampRange():Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must be a w3c formated date time string that is in the MySQL timestamp range (1970 to 2037).

public validOrderId():Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must be a valid order ID for an order that is not deleted.

public validOrderItemId():Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must be a valid order item ID for an order that is not deleted.

public customRule($rule, $params):Plenty\Validation\DummyAttribute
Return type: DummyAttribute

Add custom Role

Parameters

Name

Type

Description

$rule

string

$params

array

public validPlentyId():Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must be a valid plentyId.

public validPlentyUrl():Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field must be a valid URL.

public validPlentyDomain():Plenty\Validation\DummyAttribute
Return type: DummyAttribute

Custom validation rule for checking the existence of a given domain.

public typeFromDb($table, $column, $attribute, $comparisonKey = &quot;id&quot;):Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must have the type specified in the database.

Parameters

Name

Type

Description

$table

string

The table with the data type

$column

string

The column with the data type

$attribute

string

The attribute in the validator with the key

$comparisonKey

string

The column to in $table to compare $attribute to. Default is 'id'.

public hexColor():void

The field under validation must be a valid HEX color (like "#a3d" or "#a0787c").

public rgbColor():void

The field under validation must be a valid RGB or RGBA color (like "rgb(0, 200, 150)" or "rgba(0, 200, 150, 0.52)").

public cssColor():void

The field under validation must be a valid predefined CSS color (like "aquamarine" or "skyblue").

public color():void

The field under validation must be a valid color (HEX like "#a0787c", RGB like "rgb(0, 200, 150)" or CSS like "aquamarine")

public uuid5():void

The field under validation must be a valid UUID version 5.

public validDbType():Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must be a valid data type used by the validation rule 'typeFromDb'.

public validCurrency():Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must be a valid currency string (e.g. 'EUR').

public validBoardTaskReferenceValue():Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must be a valid board task reference type (e.g. {@link BoardTaskReferenceType::CONTACT}).

public validPhoneNumber($option):Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must be a valid phone number

Parameters

Name

Type

Description

$option

string

public validMailAddress():Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must be a valid mail address

public arrayKeysInList($acceptedKeysList):Plenty\Validation\DummyAttribute
Return type: DummyAttribute

The field under validation must be an array and must contain only the keys in the provided accepted list.

Parameters

Name

Type

Description

$acceptedKeysList

RulesCollection

RulesCollection represents a collection of rules connected to an attribute

Namespace

Plenty\Validation

Methods
public add($attributeName):Plenty\Validation\Contracts\Attribute
Return type: Attribute

Add attribute without type

Parameters

Name

Type

Description

$attributeName

string

public addConditional($attributeName, $required):Plenty\Validation\Contracts\Attribute
Return type: Attribute

Add attribute without type (with or without requirement)

Parameters

Name

Type

Description

$attributeName

string

$required

bool

public addInt($attributeName, $required = false):Plenty\Validation\Contracts\Attribute
Return type: Attribute

Add int attribute

Parameters

Name

Type

Description

$attributeName

string

$required

bool

public addNumeric($attributeName, $required = false):Plenty\Validation\Contracts\Attribute
Return type: Attribute

Add numeric attribute

Parameters

Name

Type

Description

$attributeName

string

$required

bool

public addDate($attributeName, $required = false):Plenty\Validation\Contracts\Attribute
Return type: Attribute

Add date attribute

Parameters

Name

Type

Description

$attributeName

string

$required

bool

public addBool($attributeName, $required = false):Plenty\Validation\Contracts\Attribute
Return type: Attribute

Add bool attribute

Parameters

Name

Type

Description

$attributeName

string

$required

bool

public addString($attributeName, $required = false):Plenty\Validation\Contracts\Attribute
Return type: Attribute

Add string attribute

Parameters

Name

Type

Description

$attributeName

string

$required

bool

public sometimes($attributeName, $condition):Plenty\Validation\Contracts\Attribute
Return type: Attribute

Add a rule for an attribute based on the result of the condition callback.

Parameters

Name

Type

Description

$attributeName

string

$condition

callable

public arrayKeysInList($attributeName, $acceptedKeysList):Plenty\Validation\Contracts\Attribute
Return type: Attribute

Add condition to validate if a list contains specific keys

Parameters

Name

Type

Description

$attributeName

string

$acceptedKeysList

array

Validator

Base Validator Class

Namespace

Plenty\Validation

Properties
Name Type Description

customMessageKey

Methods
public static validateOrFail($data):void

Validate the given data against the rules of this validtor

Parameters

Name

Type

Description

$data

array

public each($attributeName):Plenty\Validation\RulesCollection
Return type: RulesCollection

Add conditions to each item of a list

Parameters

Name

Type

Description

$attributeName

string

public buildCustomMessages():array

Load translated custom message

public getAttributeValue($attribute):void

Get the value of the given attribute.

Parameters

Name

Type

Description

$attribute

string

public defineAttributes():void

Must be implemented in each subclass. Define the attributes for the validator.

public add($attributeName):Plenty\Validation\Contracts\Attribute
Return type: Attribute

Add attribute without type

Parameters

Name

Type

Description

$attributeName

string

public addConditional($attributeName, $required):Plenty\Validation\Contracts\Attribute
Return type: Attribute

Add attribute without type (with or without requirement)

Parameters

Name

Type

Description

$attributeName

string

$required

bool

public addInt($attributeName, $required = false):Plenty\Validation\Contracts\Attribute
Return type: Attribute

Add int attribute

Parameters

Name

Type

Description

$attributeName

string

$required

bool

public addNumeric($attributeName, $required = false):Plenty\Validation\Contracts\Attribute
Return type: Attribute

Add numeric attribute

Parameters

Name

Type

Description

$attributeName

string

$required

bool

public addDate($attributeName, $required = false):Plenty\Validation\Contracts\Attribute
Return type: Attribute

Add date attribute

Parameters

Name

Type

Description

$attributeName

string

$required

bool

public addBool($attributeName, $required = false):Plenty\Validation\Contracts\Attribute
Return type: Attribute

Add bool attribute

Parameters

Name

Type

Description

$attributeName

string

$required

bool

public addString($attributeName, $required = false):Plenty\Validation\Contracts\Attribute
Return type: Attribute

Add string attribute

Parameters

Name

Type

Description

$attributeName

string

$required

bool

public sometimes($attributeName, $condition):Plenty\Validation\Contracts\Attribute
Return type: Attribute

Add a rule for an attribute based on the result of the condition callback.

Parameters

Name

Type

Description

$attributeName

string

$condition

callable

public arrayKeysInList($attributeName, $acceptedKeysList):Plenty\Validation\Contracts\Attribute
Return type: Attribute

Add condition to validate if a list contains specific keys

Parameters

Name

Type

Description

$attributeName

string

$acceptedKeysList

array

Exceptions

ValidationException

Namespace

Plenty\Exceptions

Properties
Name Type Description

messageBag

Methods
public getMessageBag():Illuminate\Support\MessageBag
Return type: MessageBag
public setMessageBag($messageBag):Plenty\Exceptions\ValidationException
Return type: ValidationException
Parameters

Name

Type

Description

$messageBag

MessageBag

Plugin

Build

CheckProcess

check process

Namespace

Plenty\Plugin\Build

Methods
public addError($message):void
Parameters

Name

Type

Description

$message

string

Error

HTTPException

Created by ptopczewski, 29.12.15 13:48 Class HTTPException

Namespace

Plenty\Plugin\Error

Methods
public __construct($statusCode, $message, $previous = null):void

HTTPException constructor.

Parameters

Name

Type

Description

$statusCode

string

$message

string

$previous

Events

Dispatcher

Dispatcher

Namespace

Plenty\Plugin\Events

Methods
public isPublicEvent($event):bool
Parameters

Name

Type

Description

$event

string

public listen($event, $listener, $priority):void

Register an event listener with the dispatcher.

Parameters

Name

Type

Description

$event

$listener

$priority

int

public hasListeners($event):bool

Determine if a given event has listeners.

Parameters

Name

Type

Description

$event

public fire($event, $payload = []):void

Fire an event and call the listeners.

Parameters

Name

Type

Description

$event

$payload

array

public dispatch($event, $payload = []):void

Fire an event and call the listeners.

Parameters

Name

Type

Description

$event

$payload

array

public forget($event):void

Remove a set of listeners from the dispatcher.

Parameters

Name

Type

Description

$event

public static getPrefix():string

Event

Event

Namespace

Plenty\Plugin\Events

ShouldQueue

Class that allows plugin event listeners to be queued.

Namespace

Plenty\Plugin\Events

Http

Request

http request

Namespace

Plenty\Plugin\Http

Methods
public all():array

Get all of the input and files for the request.

public merge($input):void

Merge new input into the current request's input array.

Parameters

Name

Type

Description

$input

array

public replace($input):void

Replace the input for the current request.

Parameters

Name

Type

Description

$input

array

public get($key, $default = null, $deep = false):void
Parameters

Name

Type

Description

$key

string

$default

$deep

bool

public getContent():string

Returns the request body content.

public getRequestUri():string

Returns the requested URI (path and query string).

public exists($key):bool

Determine if the request contains a given input item key.

Parameters

Name

Type

Description

$key

public has($key):bool

Determine if the request contains a non-empty value for an input item.

Parameters

Name

Type

Description

$key

public input($key = null, $default = null):void

Retrieve an input item from the request.

Parameters

Name

Type

Description

$key

string

$default

public only($keys):array

Get a subset of the items from the input data.

Parameters

Name

Type

Description

$keys

public except($keys):array

Get all of the input except for a specified array of items.

Parameters

Name

Type

Description

$keys

public query($key = null, $default = null):void

Retrieve a query string item from the request.

Parameters

Name

Type

Description

$key

string

$default

public hasHeader($key):bool

Determine if a header is set on the request.

Parameters

Name

Type

Description

$key

string

Retrieve a header from the request.

Parameters

Name

Type

Description

$key

string

$default

public isJson():bool

Determine if the request is sending JSON.

public wantsJson():bool

Determine if the current request is asking for JSON in return.

public accepts($contentTypes):bool

Determines whether the current requests accepts a given content type.

Parameters

Name

Type

Description

$contentTypes

public prefers($contentTypes):string

Return the most suitable content type from the given array based on content negotiation.

Parameters

Name

Type

Description

$contentTypes

public acceptsJson():bool

Determines whether a request accepts JSON.

public acceptsHtml():bool

Determines whether a request accepts HTML.

public format($default = &quot;html&quot;):string

Get the data format expected in the response.

Parameters

Name

Type

Description

$default

string

public getUserInfo():string

Gets the user info.

public getHttpHost():string

Returns the HTTP host being requested.

public getSchemeAndHttpHost():string

Gets the scheme and HTTP host.

public getUri():string

Generates a normalized URI (URL) for the Request.

public getUriForPath($path):string

Generates a normalized URI for the given path.

Parameters

Name

Type

Description

$path

string

A path to use instead of the current one

public getQueryString():string

Generates the normalized query string for the Request.

public getMethod():string

Gets the request "intended" method.

public getLocale():string

Get the locale.

Response

Class to create different types of http response.

Namespace

Plenty\Plugin\Http

Methods
public getHeaders():void

Get the headers for the response.

public status():int

Get the status code for the response.

public content():string

Get the content of the response.

public make($content = &quot;&quot;, $status = 200, $headers = []):Plenty\Plugin\Http\Response
Return type: Response

Return a new response from the application.

Parameters

Name

Type

Description

$content

string

$status

int

$headers

array

public view($view, $data = [], $status = 200, $headers = []):Plenty\Plugin\Http\Response
Return type: Response

Return a new view response from the application.

Parameters

Name

Type

Description

$view

string

$data

array

$status

int

$headers

array

public json($data = [], $status = 200, $headers = [], $options):Symfony\Component\HttpFoundation\Response
Return type: Response

Return a new JSON response from the application.

Parameters

Name

Type

Description

$data

$status

int

$headers

array

$options

int

public jsonp($callback, $data = [], $status = 200, $headers = [], $options):Symfony\Component\HttpFoundation\Response
Return type: Response

Return a new JSONP response from the application.

Parameters

Name

Type

Description

$callback

string

$data

$status

int

$headers

array

$options

int

public stream($callback, $status = 200, $headers = []):Symfony\Component\HttpFoundation\Response
Return type: Response

Return a new streamed response from the application.

Parameters

Name

Type

Description

$callback

callable

$status

int

$headers

array

public redirectTo($path, $status = 302, $headers = [], $secure = null):Symfony\Component\HttpFoundation\Response
Return type: Response

Create a new redirect response to the given path.

Parameters

Name

Type

Description

$path

string

$status

int

$headers

array

$secure

bool

public redirectToRoute($route, $parameters = [], $status = 302, $headers = []):Symfony\Component\HttpFoundation\Response
Return type: Response

Create a new redirect response to a named route.

Parameters

Name

Type

Description

$route

string

$parameters

array

$status

int

$headers

array

public redirectToAction($action, $parameters = [], $status = 302, $headers = []):Symfony\Component\HttpFoundation\Response
Return type: Response

Create a new redirect response to a controller action.

Parameters

Name

Type

Description

$action

string

$parameters

array

$status

int

$headers

array

public redirectGuest($path, $status = 302, $headers = [], $secure = null):Symfony\Component\HttpFoundation\Response
Return type: Response

Create a new redirect response, while putting the current URL in the session.

Parameters

Name

Type

Description

$path

string

$status

int

$headers

array

$secure

bool

public redirectToIntended($default = &quot;/&quot;, $status = 302, $headers = [], $secure = null):Symfony\Component\HttpFoundation\Response
Return type: Response

Create a new redirect response to the previously intended location.

Parameters

Name

Type

Description

$default

string

$status

int

$headers

array

$secure

bool

public sendHeaders():Plenty\Plugin\Http\Response
Return type: Response

Send the HTTP headers without sending the whole response.

public forceStatus($status = 200):Plenty\Plugin\Http\Response
Return type: Response

Force sending response with defined status instead of falling back to default handlers in case of 40* status codes.

Parameters

Name

Type

Description

$status

int

public isStatusForced():bool

Check if response should be send instead of falling back to default handlers in case of 40* status codes.

Log

LoggerFactory

Logger factory

Namespace

Plenty\Plugin\Log

Methods
public getLogger($pluginNamespace, $identifier):Plenty\Log\Contracts\LoggerContract
Return type: LoggerContract
Parameters

Name

Type

Description

$pluginNamespace

string

$identifier

string

Routing

ApiRouter

Api router service

Namespace

Plenty\Plugin\Routing

Methods
public version($version, $second, $third = null):void
Parameters

Name

Type

Description

$version

array

$second

$third

public get($uri, $action):Plenty\Plugin\Routing\Route
Return type: Route

Register a new GET route with the router.

Parameters

Name

Type

Description

$uri

string

$action

public post($uri, $action):Plenty\Plugin\Routing\Route
Return type: Route

Register a new POST route with the router.

Parameters

Name

Type

Description

$uri

string

$action

public put($uri, $action):Plenty\Plugin\Routing\Route
Return type: Route

Register a new PUT route with the router.

Parameters

Name

Type

Description

$uri

string

$action

public patch($uri, $action):Plenty\Plugin\Routing\Route
Return type: Route

Register a new PATCH route with the router.

Parameters

Name

Type

Description

$uri

string

$action

public delete($uri, $action):Plenty\Plugin\Routing\Route
Return type: Route

Register a new DELETE route with the router.

Parameters

Name

Type

Description

$uri

string

$action

public options($uri, $action):Plenty\Plugin\Routing\Route
Return type: Route

Register a new OPTIONS route with the router.

Parameters

Name

Type

Description

$uri

string

$action

public any($uri, $action):Plenty\Plugin\Routing\Route
Return type: Route

Register a new route responding to all verbs.

Parameters

Name

Type

Description

$uri

string

$action

public resource($name, $controller, $options = []):void

Route a resource to a controller.

Parameters

Name

Type

Description

$name

string

$controller

string

$options

array

public match($methods, $uri, $action):Plenty\Plugin\Routing\Route
Return type: Route

Register a new route with the given verbs.

Parameters

Name

Type

Description

$methods

array

$uri

string

$action

Route

Route

Namespace

Plenty\Plugin\Routing

Methods
public addMiddleware($middleware):Plenty\Plugin\Routing\Route
Return type: Route

Add middlewares attached to the route.

Parameters

Name

Type

Description

$middleware

array

public middleware($middleware = []):Plenty\Plugin\Routing\Route
Return type: Route

Get or set the middlewares attached to the route.

Parameters

Name

Type

Description

$middleware

array

public getMiddleware():array
public where($name, $expression = null):Plenty\Plugin\Routing\Route
Return type: Route
Parameters

Name

Type

Description

$name

string

$expression

Router

Router service

Namespace

Plenty\Plugin\Routing

Methods
public static addRoute($route):void
Parameters

Name

Type

Description

$route

public get($uri, $action):Plenty\Plugin\Routing\Route
Return type: Route

Register a new GET route with the router.

Parameters

Name

Type

Description

$uri

string

$action

public post($uri, $action):Plenty\Plugin\Routing\Route
Return type: Route

Register a new POST route with the router.

Parameters

Name

Type

Description

$uri

string

$action

public put($uri, $action):Plenty\Plugin\Routing\Route
Return type: Route

Register a new PUT route with the router.

Parameters

Name

Type

Description

$uri

string

$action

public patch($uri, $action):Plenty\Plugin\Routing\Route
Return type: Route

Register a new PATCH route with the router.

Parameters

Name

Type

Description

$uri

string

$action

public delete($uri, $action):Plenty\Plugin\Routing\Route
Return type: Route

Register a new DELETE route with the router.

Parameters

Name

Type

Description

$uri

string

$action

public options($uri, $action):Plenty\Plugin\Routing\Route
Return type: Route

Register a new OPTIONS route with the router.

Parameters

Name

Type

Description

$uri

string

$action

public any($uri, $action):Plenty\Plugin\Routing\Route
Return type: Route

Register a new route responding to all verbs.

Parameters

Name

Type

Description

$uri

string

$action

public match($methods, $uri, $action):Plenty\Plugin\Routing\Route
Return type: Route

Register a new route with the given verbs.

Parameters

Name

Type

Description

$methods

array

$uri

string

$action

public middleware($name, $class):Plenty\Plugin\Routing\Router
Return type: Router

Register a short-hand name for a middleware.

Parameters

Name

Type

Description

$name

string

$class

string

public prepareResponse($request, $response):Plenty\Plugin\Http\Response
Return type: Response

Create a response instance from the given value.

Parameters

Name

Type

Description

$request

Request

$response

Response

Templates

Markdown

A simple markdown converter.

Namespace

Plenty\Plugin\Templates

Methods
public renderToHtml($markdownContent):string
Parameters

Name

Type

Description

$markdownContent

string

Twig

Twig engine

Namespace

Plenty\Plugin\Templates

Methods
public render($name, $context = []):string

Renders a template.

Parameters

Name

Type

Description

$name

string

The template name

$context

array

An array of parameters to pass to the template

public renderString($templateContent, $context = []):string

Compile and render a twig template from a string.

Parameters

Name

Type

Description

$templateContent

string

The template to render

$context

array

An array of parameters to pass to the template

public addExtension($extension):void

Registers an extension.

Parameters

Name

Type

Description

$extension

string

A Twig_ExtensionInterface instance

View

view support

Namespace

Plenty\Plugin\Templates

Methods
public render($templatePath, $data = []):string
Parameters

Name

Type

Description

$templatePath

string

$data

array

public exists($templatePath):bool
Parameters

Name

Type

Description

$templatePath

string

Translation

Translator

translation service

Namespace

Plenty\Plugin\Translation

Methods
public get($id, $parameters = [], $locale = null):void

Get the translation for a given key.

Parameters

Name

Type

Description

$id

string

$parameters

array

$locale

string

public trans($id, $parameters = [], $locale = null):void

Get the translation for a given key.

Parameters

Name

Type

Description

$id

string

$parameters

array

$locale

string

Data

Contracts

PropertyDescriptor

describes properties of a Model

Namespace

Plenty\Plugin\Data\Contracts

Methods
public getPropertyInformation($modelClassName):array
Parameters

Name

Type

Description

$modelClassName

string

Resources

Resource

Namespace

Plenty\Plugin\Data\Contracts

Methods
public load($resourceName, $options = []):Plenty\Plugin\Data\Model\ResourceInformation
Return type: ResourceInformation
Parameters

Name

Type

Description

$resourceName

string

$options

array

public exists($resourceName):bool
Parameters

Name

Type

Description

$resourceName

string

Model

PropertyInformation

property information

Namespace

Plenty\Plugin\Data\Model

Methods
public getType():string
public getName():string
public getDescription():string

ResourceInformation

resource information

Namespace

Plenty\Plugin\Data\Model

Methods
public getPath():string
public getContentUrl():string
public getData():void

ExternalAuth

Contracts

ExternalAccessRepositoryContract

Find and create ExternalAccess-datasets

Namespace

Plenty\Plugin\ExternalAuth\Contracts

Methods
public create($data):Plenty\Plugin\ExternalAuth\Models\ExternalAccess
Return type: ExternalAccess

Create a new ExternalAccess record

Parameters

Name

Type

Description

$data

array

The data for the ExternalAccess record to be created with. Must be an associative array with the keys 'contactId', 'accessType', 'externalContactId' and optionally an external 'accessToken'.

public findForTypeAndExternalId($type, $externalId):Plenty\Plugin\ExternalAuth\Models\ExternalAccess
Return type: ExternalAccess

Find

Parameters

Name

Type

Description

$type

string

The type of the external access

$externalId

string

The external ID of the contact

public findForTypeAndContactId($type, $contactId):Plenty\Plugin\ExternalAuth\Models\ExternalAccess
Return type: ExternalAccess
Parameters

Name

Type

Description

$type

string

The type of the external access

$contactId

int

The (internal) ID of the contact

Models

ExternalAccess

Information on a contact's external access tokens

Namespace

Plenty\Plugin\ExternalAuth\Models

Properties
Name Type Description

contactId

int

The ID of the contact in question. Must be unique in combination with $accessType.

accessType

string

The type/provider of external access. Must be unique in combination with $contactId.

externalContactId

string

The ID of the contact at the external provider.

accessToken

string

The token for the external access.

lastUpdate

Carbon

The Date when this record was updated the last time.

Methods
public toArray()

Returns this model as an array.

Services

ExternalAuthService

Log in users with external auth

Namespace

Plenty\Plugin\ExternalAuth\Services

Methods
public logInWithExternalUserId($externalId, $type):void
Parameters

Name

Type

Description

$externalId

string

$type

string

Mail

Contracts

AwsSesContract

Plugin AWS Simple Email Service

Namespace

Plenty\Plugin\Mail\Contracts

Methods
public sendEmail($email, $credentials):Plenty\Plugin\Mail\Models\EmailSenderResult
Return type: EmailSenderResult

Composes an email message and immediately queues it for sending via AWS SES

Parameters

Name

Type

Description

$email

Email

$credentials

AwsSesCredentials

MailerContract

Plugin Mailer Service

Namespace

Plenty\Plugin\Mail\Contracts

Methods
public sendHtml($html, $recipients, $subject = &quot;&quot;, $cc = [], $bcc = [], $replyTo = null, $attachments = []):void

Send an email containing html

Parameters

Name

Type

Description

$html

string

The HTML-String for the email body

$recipients

Either a string containing a single email address or an array of strings containing multiple email addresses

$subject

string

Optional. The subject of the message

$cc

array

Optional. Array of strings containing email addresses which the message should be sent to as cc

$bcc

array

Optional. Array of strings containing email addresses which the message should be sent to as bcc

$replyTo

ReplyTo

Optional. ReplyToRecipient model with mailaddress and name attributes

$attachments

array

Optional. A list of StorageObject objects ( see Plenty\Modules\Plugin\Storage\Contracts\StorageRepositoryContract )

public sendFromTwig($twigPath, $data, $recipients, $subject = &quot;&quot;, $altConfig = [], $cc = [], $bcc = [], $replyTo = null, $attachments = []):void

Send an email that will get rendered by twig

Parameters

Name

Type

Description

$twigPath

string

The path to the twig template file that should be used to render the mail. E.g.: 'PluginNamespace::mail.my_mail'

$data

array

An associative array of data that will be available to the twig template

$recipients

Either a string containing a single email address or an array of strings containing multiple email addresses

$subject

string

Optional. The subject of the message

$altConfig

array

Optional. Alternative email config. If present MUST be an associative array with the keys 'host', 'port', 'username', 'password' and 'encryption'. It CAN optionally have a key 'from' to set the sender-address to something else than specified in the system config. If 'from' is missing, the system-wide configured sender-address is used.

$cc

array

Optional. Array of strings containing email addresses which the message should be sent to as cc

$bcc

array

Optional. Array of strings containing email addresses which the message should be sent to as bcc

$replyTo

ReplyTo

Optional. ReplyToRecipient model with mailaddress and name attributes

$attachments

array

Optional. A list of StorageObject objects ( see Plenty\Modules\Plugin\Storage\Contracts\StorageRepositoryContract )

public sendFromMime($mimeMessage, $recipients, $altConfig = [], $cc = [], $bcc = [], $replyTo = null, $attachments = []):void

Send given message as email

Parameters

Name

Type

Description

$mimeMessage

string

Complete email mime source header included

$recipients

Either a string containing a single email address or an array of strings containing multiple email addresses

$altConfig

array

Optional. Alternative email config. If present MUST be an associative array with the keys 'host', 'port', 'username', 'password' and 'encryption'. It CAN optionally have a key 'from' to set the sender-address to something else than specified in the system config. If 'from' is missing, the system-wide configured sender-address is used.

$cc

array

Optional. Array of strings containing email addresses which the message should be sent to as cc

$bcc

array

Optional. Array of strings containing email addresses which the message should be sent to as bcc

$replyTo

ReplyTo

Optional. ReplyToRecipient model with mailaddress and name attributes

$attachments

array

Optional. A list of StorageObject objects ( see Plenty\Modules\Plugin\Storage\Contracts\StorageRepositoryContract )

Models

AwsSesCredentials

the credential model for AWS SES client.

Namespace

Plenty\Plugin\Mail\Models

Properties
Name Type Description

region

string

AWS region e.g. eu-west-1

accessKeyId

string

User access key

secretAccessKey

string

User secret access key

Methods
public toArray()

Returns this model as an array.

Email

the email model.

Namespace

Plenty\Plugin\Mail\Models

Properties
Name Type Description

bccAddresses

array

BCC email address

ccAddresses

array

CC email address

toAddresses

array

To email address

senderAddress

string

Sender email address

replyToAddresses

array

Reply to email address

subject

string

Email subject

htmlBody

string

HTML email body

plainTextBody

string

Plain text email body

rawMessage

string

MIME message, if set subject, html and plainText are ignored

Methods
public toArray()

Returns this model as an array.

EmailSenderResult

the email sender result model.

Namespace

Plenty\Plugin\Mail\Models

Properties
Name Type Description

messageId

int

message

string

errorCode

int

Methods
public toArray()

Returns this model as an array.

ReplyTo

ReplyTo

Namespace

Plenty\Plugin\Mail\Models

Properties
Name Type Description

mailAddress

string

The mail address to reply.

name

string

The name to reply.

Methods
public toArray()

Returns this model as an array.

Templates

Extensions

TwigFilter

TwigFilter

Namespace

Plenty\Plugin\Templates\Extensions

TwigFunction

TwigFunction

Namespace

Plenty\Plugin\Templates\Extensions

Twig_Extension

Twig extension

Namespace

Plenty\Plugin\Templates\Extensions

Methods
public getName():string
public getGlobals():void

Twig_SimpleFilter

Twig SimpleFilter

Namespace

Plenty\Plugin\Templates\Extensions

Twig_SimpleFunction

Twig SimpleFunction

Namespace

Plenty\Plugin\Templates\Extensions

Factories

TwigFactory

Twig Factory

Namespace

Plenty\Plugin\Templates\Factories

Methods
public register():void
public createSimpleFunction($name, $callable, $params = []):Plenty\Plugin\Templates\Extensions\Twig_SimpleFunction
Return type: Twig_SimpleFunction
Parameters

Name

Type

Description

$name

string

$callable

$params

array

An array of parameters

public createSimpleFilter($name, $callable, $params = []):Plenty\Plugin\Templates\Extensions\Twig_SimpleFilter
Return type: Twig_SimpleFilter
Parameters

Name

Type

Description

$name

string

$callable

$params

array

An array of parameters

Repositories

Contracts

DeleteResponseContract

DeleteResponse Interface

Namespace

Plenty\Repositories\Contracts

Methods
public getAffectedRows():int
public setAffectedRows($value):void
Parameters

Name

Type

Description

$value

int

public increment():int
public decrement():int

PaginationResponseContract

Contract for PaginationResponse

Namespace

Plenty\Repositories\Contracts

Methods
public getTotal():void
public setTotal($total):void
Parameters

Name

Type

Description

$total

public getPage():void
public setPage($page):void
Parameters

Name

Type

Description

$page

public getEntriesPerPage():void
public setEntriesPerPage($epp):void
Parameters

Name

Type

Description

$epp

public getResult():void
public setResult($entries):void
Parameters

Name

Type

Description

$entries

public toJson($options):string

Convert the object to its JSON representation.

Parameters

Name

Type

Description

$options

int

public toArray():array

Get the instance as an array.

Criteria

Comparison

comparison class

Namespace

Plenty\Repositories\Criteria

Methods
public getOperator():string
public getTerm():void
public isOperator($comparison):bool
Parameters

Name

Type

Description

$comparison

string

public castTerm($castTo):void
Parameters

Name

Type

Description

$castTo

string

PluginCriteria

The contract for defining criteria.

Namespace

Plenty\Repositories\Criteria

Methods
public comparisons():array
public apply($builder, $repository):void
Parameters

Name

Type

Description

$builder

$repository

CriteriableContract

public allowedComparators():array

Models

DeleteResponse

Delete Response

Namespace

Plenty\Repositories\Models

Properties
Name Type Description

affectedRows

int

Methods
public toArray()

Returns this model as an array.

FilteredPaginatedResult

Filtered paginated result

Namespace

Plenty\Repositories\Models

Methods
public getFilters():array
public setFilters($filters):void
Parameters

Name

Type

Description

$filters

array

public toArray():array

Get the instance as an array.

public paginate():Plenty\Repositories\Models\PaginatedResult
Return type: PaginatedResult
public getPage():int

Returns the page number as received

public getCurrentPage():int

Returns the normalized page number - checked if out of logical bounds ( not below 0, not greater than the last page ) and adjusted

public getTotalCount():int
public isLastPage():bool
public getItemIndexFrom():int
public getItemIndexTo():int
public getLastPage():int
public getResult():array
public setResult($result):void
Parameters

Name

Type

Description

$result

public sumMetaData($metaColumn = &quot;&quot;, $groupBy = &quot;&quot;, $metaDataName = &quot;&quot;):void
Parameters

Name

Type

Description

$metaColumn

string

$groupBy

string

$metaDataName

string

public rowCountMetaData($metaColumn = &quot;&quot;, $groupBy = &quot;&quot;, $metaDataName = &quot;&quot;):void
Parameters

Name

Type

Description

$metaColumn

string

$groupBy

string

$metaDataName

string

public toJson($options):string

Convert the object to its JSON representation.

Parameters

Name

Type

Description

$options

int

public jsonSerialize():void

Specify data which should be serialized to JSON

PaginatedResult

paginated result

Namespace

Plenty\Repositories\Models

Methods
public paginate():Plenty\Repositories\Models\PaginatedResult
Return type: PaginatedResult
public getPage():int

Returns the page number as received

public getCurrentPage():int

Returns the normalized page number - checked if out of logical bounds ( not below 0, not greater than the last page ) and adjusted

public getTotalCount():int
public isLastPage():bool
public getItemIndexFrom():int
public getItemIndexTo():int
public getLastPage():int
public getResult():array
public setResult($result):void
Parameters

Name

Type

Description

$result

public sumMetaData($metaColumn = &quot;&quot;, $groupBy = &quot;&quot;, $metaDataName = &quot;&quot;):void
Parameters

Name

Type

Description

$metaColumn

string

$groupBy

string

$metaDataName

string

public rowCountMetaData($metaColumn = &quot;&quot;, $groupBy = &quot;&quot;, $metaDataName = &quot;&quot;):void
Parameters

Name

Type

Description

$metaColumn

string

$groupBy

string

$metaDataName

string

public toArray():array

Get the instance as an array.

public toJson($options):string

Convert the object to its JSON representation.

Parameters

Name

Type

Description

$options

int

public jsonSerialize():void

Specify data which should be serialized to JSON

UnspecifiedLengthPaginationResponse

Unspecified length pagination response

Namespace

Plenty\Repositories\Models

Methods
public getPage():int
public getItemsPerPage():int
public getFirstOnPage():void
public getLastOnPage():void
public isLastPage():bool
public jsonSerialize():array

Services

RequestPaginationOptionsProvider

Array pagination

Namespace

Plenty\Repositories\Services

Methods
public setCurrentItemsPerPage($currentItemsPerPage):Plenty\Repositories\Services\RequestPaginationOptionsProvider
Return type: RequestPaginationOptionsProvider
Parameters

Name

Type

Description

$currentItemsPerPage

int

public setCurrentPage($currentPage):Plenty\Repositories\Services\RequestPaginationOptionsProvider
Return type: RequestPaginationOptionsProvider
Parameters

Name

Type

Description

$currentPage

int

public getCurrentItemsPerPage():int
public getCurrentPage():int

SimpleArrayPagination

Array pagination

Namespace

Plenty\Repositories\Services

Methods
public buildResult($page, $offset):Illuminate\Support\Collection
Return type: Collection
Parameters

Name

Type

Description

$page

int

$offset

int

public getTotalCount():int

Criteria

Containers

CriteriaContainer

Register repository criteria

Namespace

Plenty\Repositories\Criteria\Containers

Methods
public add($repository, $criteria, $key):Plenty\Repositories\Criteria\Containers\CriteriaContainer
Return type: CriteriaContainer

Use this method to add criteria to a existing repository.

Parameters

Name

Type

Description

$repository

string

The repository that should use the criteria

$criteria

string

The criteria class name that should be used.

$key

string

The key that should match the given criteria.

Contracts

CriteriableContract

Interface which provides the possibility to use Criteria filters.

Namespace

Plenty\Repositories\Criteria\Contracts

Methods
public clearCriteria():void

Resets all Criteria filters by creating a new instance of the builder object.

public applyCriteriaFromFilters():void

Applies criteria classes to the current repository.

ExtendsCriteriaContract

Interface which provides the possibility to extends repositories with new Criteria filters.

Namespace

Plenty\Repositories\Criteria\Contracts

Validation

Contracts

Attribute

Common interface for attribute classes

Namespace

Plenty\Validation\Contracts

Methods
public getAttributeName():string

Returns the attribute's name

public setAttributeName($attributeName):Plenty\Validation\Contracts\Attribute
Return type: Attribute

Sets the attribute's name

Parameters

Name

Type

Description

$attributeName

string

public accepted():Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be yes, on, 1, or true. This is useful for validating "Terms of Service" acceptance.

public customRule($rule, $params):Plenty\Validation\Contracts\Attribute
Return type: Attribute

Add custom Role

Parameters

Name

Type

Description

$rule

string

$params

array

public activeUrl():Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be a valid URL according to the checkdnsrr PHP function.

public dateAfter($fieldNameOrTimeStr):Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be a value after a given date. The dates will be passed into the strtotime PHP function. Instead of passing a date string to be evaluated by strtotime, you may specify another field to compare against the date

Parameters

Name

Type

Description

$fieldNameOrTimeStr

string

public alphabetic():Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be entirely alphabetic characters.

public alphaDash():Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation may have alpha-numeric characters, as well as dashes and underscores.

public alphaNum():Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be entirely alpha-numeric characters.

public isArray():Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be a PHP array.

public dateBefore($fieldNameOrTimeStr):Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be a value preceding the given date. The dates will be passed into the PHP strtotime function.

Parameters

Name

Type

Description

$fieldNameOrTimeStr

string

public between($min, $max):Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must have a size between the given min and max. Strings, numerics, and files are evaluated in the same fashion as the size rule.

Parameters

Name

Type

Description

$min

int

$max

int

public boolean():Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be able to be cast as a boolean. Accepted input are true, false, 1, 0, "1", and "0".

public confirmed():Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must have a matching field of foo_confirmation. For example, if the field under validation is password, a matching password_confirmation field must be present in the input.

public present():Plenty\Validation\Contracts\Attribute
Return type: Attribute

Validate that an attribute exists even if not filled.

public date():Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be a valid date according to the strtotime PHP function.

public dateFormat($format):Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must match the given format. The format will be evaluated using the PHP date_parse_from_format function. You should use either date or date_format when validating a field, not both.

Parameters

Name

Type

Description

$format

string

public dateW3C($allowTimestamps = false):Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be a valid w3c formated date time string.

Parameters

Name

Type

Description

$allowTimestamps

bool

Allow timestamps as a valid format as well.

public inTimestampRange():Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be a w3c formated date time string that is in the MySQL timestamp range (1970 to 2037).

public validOrderId():Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be a valid order ID for an order that is not deleted.

public validOrderItemId():Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be a valid order item ID for an order that is not deleted.

public validPlentyId():Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be a valid plentyId.

public validPlentyUrl():Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be a valid plentyId.

public validPlentyDomain():Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be a unique domain.

public typeFromDb($table, $column, $attribute, $comparisonKey = &quot;id&quot;):Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must have the type specified in the database.

Parameters

Name

Type

Description

$table

string

The table with the data type

$column

string

The column with the data type

$attribute

string

The attribute in the validator with the key

$comparisonKey

string

The column to in $table to compare $attribute to. Default is 'id'.

public hexColor():Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be a valid HEX color (like "#a3d" or "#a0787c").

public rgbColor():Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be a valid RGB or RGBA color (like "rgb(0, 200, 150)" or "rgba(0, 200, 150, 0.52)").

public cssColor():Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be a valid predefined CSS color (like "aquamarine" or "skyblue").

public color():Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be a valid color (HEX like "#a0787c", RGB like "rgb(0, 200, 150)" or CSS like "aquamarine")

public uuid5():Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be a valid UUID version 5.

public validDbType():Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be a valid data type used by the validation rule 'typeFromDb'.

public validCurrency():Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be a valid currency string (e.g. 'EUR').

public different($fieldName):Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must have a different value than field.

Parameters

Name

Type

Description

$fieldName

string

public digits($count):Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be numeric and must have an exact length of $count.

Parameters

Name

Type

Description

$count

int

public digitsBetween($min, $max):Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must have a length between the given min and max.

Parameters

Name

Type

Description

$min

int

$max

int

public email():Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be formatted as an e-mail address.

public exists($table, $columns = []):Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must exist on a given database table.

Parameters

Name

Type

Description

$table

string

$columns

array

public image():Plenty\Validation\Contracts\Attribute
Return type: Attribute

The file under validation must be an image (jpeg, png, bmp, gif, or svg)

public in($values):Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be included in the given list of values.

Parameters

Name

Type

Description

$values

array

public integer():Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be an integer.

public ip():Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be an IP address.

public json():Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must a valid JSON string.

public max($value):Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be less than or equal to a maximum value. Strings, numerics, and files are evaluated in the same fashion as the size rule.

Parameters

Name

Type

Description

$value

int

public mimeTypes($types):Plenty\Validation\Contracts\Attribute
Return type: Attribute

The file under validation must have a MIME type corresponding to one of the listed extensions.

Parameters

Name

Type

Description

$types

array

public min($value):Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must have a minimum value. Strings, numerics, and files are evaluated in the same fashion as the size rule.

Parameters

Name

Type

Description

$value

int

public notIn($values):Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must not be included in the given list of values.

Parameters

Name

Type

Description

$values

public numeric():Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be numeric.

public regex($pattern):Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must match the given regular expression.

Parameters

Name

Type

Description

$pattern

string

public required():Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be present in the input data and not empty. A field is considered "empty" is one of the following conditions are true: The value is null. The value is an empty string. The value is an empty array or empty Countable object. The value is an uploaded file with no path.

public requiredIf($fieldName, $value):Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be present if the anotherfield field is equal to any value.

Parameters

Name

Type

Description

$fieldName

string

$value

public requiredUnless($fieldName, $value):Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be present unless the anotherfield field is equal to any value.

Parameters

Name

Type

Description

$fieldName

string

$value

string

public requiredWith($fieldNames):Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be present only if any of the other specified fields are present.

Parameters

Name

Type

Description

$fieldNames

array

public requiredWithAll($fieldNames):Plenty\Validation\Contracts\Attribute
Return type: Attribute

required_with_all

Parameters

Name

Type

Description

$fieldNames

array

public requiredWithout($fieldNames):Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be present only when any of the other specified fields are not present.

Parameters

Name

Type

Description

$fieldNames

array

public requiredWithoutAll($fieldNames):Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be present only when all of the other specified fields are not present.

Parameters

Name

Type

Description

$fieldNames

array

public notLike($fieldName):Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be not like the specified name.

Parameters

Name

Type

Description

$fieldName

string

public same($fieldName):Plenty\Validation\Contracts\Attribute
Return type: Attribute

The given field must match the field under validation.

Parameters

Name

Type

Description

$fieldName

string

public size($value):Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must have a size matching the given value. For string data, value corresponds to the number of characters. For numeric data, value corresponds to a given integer value. For files, size corresponds to the file size in kilobytes.

Parameters

Name

Type

Description

$value

int

public string():Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be a string.

public timezone():Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be a valid timezone identifier according to the timezone_identifiers_list PHP function.

public unique($table, $column, $except = null, $idColumn = null):Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be unique on a given database table. If the column option is not specified, the field name will be used.

Parameters

Name

Type

Description

$table

string

$column

string

$except

string

$idColumn

string

public url():Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be a valid URL according to PHP's filter_var function.

public sometimes():Plenty\Validation\Contracts\Attribute
Return type: Attribute

In some situations, you may wish to run validation checks against a field only if that field is present in the input array. To quickly accomplish this, add the sometimes rule.

public nullable():Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation may be null. This is particularly useful when validating primitive such as strings and integers that can contain null values.

public validBoardTaskReferenceValue():Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be a valid board task reference type (e.g. {@link BoardTaskReferenceType::CONTACT}).

public arrayKeysInList($acceptedKeysList):Plenty\Validation\Contracts\Attribute
Return type: Attribute

The field under validation must be an array and must contain only the keys in the provided accepted list.

Parameters

Name

Type

Description

$acceptedKeysList

Service

AttributeFactory

Instantiates Attribute Classes

Namespace

Plenty\Validation\Service

Methods
public create($which):Plenty\Validation\Contracts\Attribute
Return type: Attribute

Creates a new attribute

Parameters

Name

Type

Description

$which

string

ValidatorFactory

Instantiates Validator Classes

Namespace

Plenty\Validation\Service

Methods
public create($validatorClass):Plenty\Validation\Validator
Return type: Validator

Creates a new validator

Parameters

Name

Type

Description

$validatorClass

string

The fully qualified classname of the validator to create (including namespace)

Illuminate

Support

MessageBag

Namespace

Illuminate\Support

Methods
public keys():array

Get the keys present in the message bag.

public add($key, $message):Illuminate\Support\MessageBag
Return type: MessageBag

Add a message to the message bag.

Parameters

Name

Type

Description

$key

string

$message

string

public addIf($boolean, $key, $message):Illuminate\Support\MessageBag
Return type: MessageBag

Add a message to the message bag if the given conditional is "true".

Parameters

Name

Type

Description

$boolean

bool

$key

string

$message

string

public merge($messages):Illuminate\Support\MessageBag
Return type: MessageBag

Merge a new array of messages into the message bag.

Parameters

Name

Type

Description

$messages

public has($key):bool

Determine if messages exist for all of the given keys.

Parameters

Name

Type

Description

$key

public hasAny($keys = []):bool

Determine if messages exist for any of the given keys.

Parameters

Name

Type

Description

$keys

public first($key = null, $format = null):string

Get the first message from the message bag for a given key.

Parameters

Name

Type

Description

$key

string

$format

string

public get($key, $format = null):array

Get all of the messages from the message bag for a given key.

Parameters

Name

Type

Description

$key

string

$format

string

public all($format = null):array

Get all of the messages for every key in the message bag.

Parameters

Name

Type

Description

$format

string

public unique($format = null):array

Get all of the unique messages for every key in the message bag.

Parameters

Name

Type

Description

$format

string

public messages():array

Get the raw messages in the message bag.

public getMessages():array

Get the raw messages in the message bag.

public getMessageBag():Illuminate\Support\Illuminate\Support\MessageBag
Return type: MessageBag

Get the messages for the instance.

public getFormat():string

Get the default message format.

public setFormat($format = &quot;:message&quot;):Illuminate\Support\Illuminate\Support\MessageBag
Return type: MessageBag

Set the default message format.

Parameters

Name

Type

Description

$format

string

public isEmpty():bool

Determine if the message bag has any messages.

public isNotEmpty():bool

Determine if the message bag has any messages.

public any():bool

Determine if the message bag has any messages.

public count():int

Get the number of messages in the message bag.

public toArray():array

Get the instance as an array.

public jsonSerialize():array

Convert the object into something JSON serializable.

public toJson($options):string

Convert the object to its JSON representation.

Parameters

Name

Type

Description

$options

int

Collection

Namespace

Illuminate\Support

Methods
public all():array

Get all of the items in the collection.

public avg($callback = null):void

Get the average value of a given key.

Parameters

Name

Type

Description

$callback

public mode($key = null):array

Get the mode of a given key.

Parameters

Name

Type

Description

$key

public collapse():Illuminate\Support\Collection
Return type: Collection

Collapse the collection of items into a single array.

public contains($key, $operator = null, $value = null):bool

Determine if an item exists in the collection.

Parameters

Name

Type

Description

$key

$operator

$value

public containsStrict($key, $value = null):bool

Determine if an item exists, using strict comparison.

Parameters

Name

Type

Description

$key

$value

public crossJoin($lists):Illuminate\Support\Collection
Return type: Collection

Cross join with the given lists, returning all possible permutations.

Parameters

Name

Type

Description

$lists

public diff($items):Illuminate\Support\Collection
Return type: Collection

Get the items in the collection that are not present in the given items.

Parameters

Name

Type

Description

$items

public diffAssoc($items):Illuminate\Support\Collection
Return type: Collection

Get the items in the collection whose keys and values are not present in the given items.

Parameters

Name

Type

Description

$items

public diffKeys($items):Illuminate\Support\Collection
Return type: Collection

Get the items in the collection whose keys are not present in the given items.

Parameters

Name

Type

Description

$items

public except($keys):Illuminate\Support\Collection
Return type: Collection

Get all items except for those with the specified keys.

Parameters

Name

Type

Description

$keys

public filter($callback = null):Illuminate\Support\Collection
Return type: Collection

Run a filter over each of the items.

Parameters

Name

Type

Description

$callback

callable

public first($callback = null, $default = null):void

Get the first item from the collection passing the given truth test.

Parameters

Name

Type

Description

$callback

callable

$default

public flip():Illuminate\Support\Collection
Return type: Collection

Flip the items in the collection.

public forget($keys):Illuminate\Support\Collection
Return type: Collection

Remove an item from the collection by key.

Parameters

Name

Type

Description

$keys

public get($key, $default = null):void

Get an item from the collection by key.

Parameters

Name

Type

Description

$key

$default

public groupBy($groupBy, $preserveKeys = false):Illuminate\Support\Collection
Return type: Collection

Group an associative array by a field or using a callback.

Parameters

Name

Type

Description

$groupBy

$preserveKeys

bool

public keyBy($keyBy):Illuminate\Support\Collection
Return type: Collection

Key an associative array by a field or using a callback.

Parameters

Name

Type

Description

$keyBy

public has($key):bool

Determine if an item exists in the collection by key.

Parameters

Name

Type

Description

$key

public implode($value, $glue = null):string

Concatenate values of a given key as a string.

Parameters

Name

Type

Description

$value

$glue

string

public intersect($items):Illuminate\Support\Collection
Return type: Collection

Intersect the collection with the given items.

Parameters

Name

Type

Description

$items

public intersectByKeys($items):Illuminate\Support\Collection
Return type: Collection

Intersect the collection with the given items by key.

Parameters

Name

Type

Description

$items

public isEmpty():bool

Determine if the collection is empty or not.

public keys():Illuminate\Support\Collection
Return type: Collection

Get the keys of the collection items.

public last($callback = null, $default = null):void

Get the last item from the collection.

Parameters

Name

Type

Description

$callback

callable

$default

public pluck($value, $key = null):Illuminate\Support\Collection
Return type: Collection

Get the values of a given key.

Parameters

Name

Type

Description

$value

$key

string

public map($callback):Illuminate\Support\Collection
Return type: Collection

Run a map over each of the items.

Parameters

Name

Type

Description

$callback

callable

public mapToDictionary($callback):Illuminate\Support\Collection
Return type: Collection

Run a dictionary map over the items.

Parameters

Name

Type

Description

$callback

callable

public mapWithKeys($callback):Illuminate\Support\Collection
Return type: Collection

Run an associative map over each of the items.

Parameters

Name

Type

Description

$callback

callable

public merge($items):Illuminate\Support\Collection
Return type: Collection

Merge the collection with the given items.

Parameters

Name

Type

Description

$items

public combine($values):Illuminate\Support\Collection
Return type: Collection

Create a collection by using this collection for keys and another for its values.

Parameters

Name

Type

Description

$values

public union($items):Illuminate\Support\Collection
Return type: Collection

Union the collection with the given items.

Parameters

Name

Type

Description

$items

public nth($step, $offset):Illuminate\Support\Collection
Return type: Collection

Create a new collection consisting of every n-th element.

Parameters

Name

Type

Description

$step

int

$offset

int

public only($keys):Illuminate\Support\Collection
Return type: Collection

Get the items with the specified keys.

Parameters

Name

Type

Description

$keys

public pop($count = 1):Illuminate\Support\Collection
Return type: Collection

Get and remove the last N items from the collection.

Parameters

Name

Type

Description

$count

int

public prepend($value, $key = null):Illuminate\Support\Collection
Return type: Collection

Push an item onto the beginning of the collection.

Parameters

Name

Type

Description

$value

$key

public push($values):Illuminate\Support\Collection
Return type: Collection

Push one or more items onto the end of the collection.

Parameters

Name

Type

Description

$values

public pull($key, $default = null):void

Get and remove an item from the collection.

Parameters

Name

Type

Description

$key

$default

public put($key, $value):Illuminate\Support\Collection
Return type: Collection

Put an item in the collection by key.

Parameters

Name

Type

Description

$key

$value

public random($number = null):Illuminate\Support\Collection
Return type: Collection

Get one or a specified number of items randomly from the collection.

Parameters

Name

Type

Description

$number

public reverse():Illuminate\Support\Collection
Return type: Collection

Reverse items order.

Search the collection for a given value and return the corresponding key if successful.

Parameters

Name

Type

Description

$value

$strict

bool

public shift($count = 1):Illuminate\Support\Collection
Return type: Collection

Get and remove the first N items from the collection.

Parameters

Name

Type

Description

$count

int

public shuffle($seed = null):Illuminate\Support\Collection
Return type: Collection

Shuffle the items in the collection.

Parameters

Name

Type

Description

$seed

int

public slice($offset, $length = null):Illuminate\Support\Collection
Return type: Collection

Slice the underlying collection array.

Parameters

Name

Type

Description

$offset

int

$length

int

public split($numberOfGroups):Illuminate\Support\Collection
Return type: Collection

Split a collection into a certain number of groups.

Parameters

Name

Type

Description

$numberOfGroups

int

public chunk($size):Illuminate\Support\Collection
Return type: Collection

Chunk the collection into chunks of the given size.

Parameters

Name

Type

Description

$size

int

public sort($callback = null):Illuminate\Support\Collection
Return type: Collection

Sort through each item with a callback.

Parameters

Name

Type

Description

$callback

public splice($offset, $length = null, $replacement = []):Illuminate\Support\Collection
Return type: Collection

Splice a portion of the underlying collection array.

Parameters

Name

Type

Description

$offset

int

$length

int

$replacement

array

public take($limit):Illuminate\Support\Collection
Return type: Collection

Take the first or last {$limit} items.

Parameters

Name

Type

Description

$limit

int

public transform($callback):Illuminate\Support\Collection
Return type: Collection

Transform each item in the collection using a callback.

Parameters

Name

Type

Description

$callback

callable

public unique($key = null, $strict = false):Illuminate\Support\Collection
Return type: Collection

Return only unique items from the collection array.

Parameters

Name

Type

Description

$key

$strict

bool

public values():Illuminate\Support\Collection
Return type: Collection

Reset the keys on the underlying array.

public zip($items):Illuminate\Support\Collection
Return type: Collection

Zip the collection together with one or more arrays.

Parameters

Name

Type

Description

$items

public pad($size, $value):Illuminate\Support\Collection
Return type: Collection

Pad collection to the specified length with a value.

Parameters

Name

Type

Description

$size

int

$value

public count():int

Count the number of items in the collection.

public offsetExists($key):bool

Determine if an item exists at an offset.

Parameters

Name

Type

Description

$key

public offsetGet($key):void

Get an item at a given offset.

Parameters

Name

Type

Description

$key

public offsetSet($key, $value):void

Set the item at a given offset.

Parameters

Name

Type

Description

$key

$value

public offsetUnset($key):void

Unset the item at a given offset.

Parameters

Name

Type

Description

$key

public static make($items = []):Illuminate\Support\Collection
Return type: Collection

Create a new collection instance if the value isn't one already.

Parameters

Name

Type

Description

$items

public static wrap($value):Illuminate\Support\Collection
Return type: Collection

Wrap the given value in a collection if applicable.

Parameters

Name

Type

Description

$value

public static unwrap($value):array

Get the underlying items from the given collection if applicable.

Parameters

Name

Type

Description

$value

public static times($number, $callback = null):Illuminate\Support\Collection
Return type: Collection

Create a new collection by invoking the callback a given amount of times.

Parameters

Name

Type

Description

$number

int

$callback

callable

public average($callback = null):void

Alias for the "avg" method.

Parameters

Name

Type

Description

$callback

public each($callback):Illuminate\Support\Collection
Return type: Collection

Execute a callback over each item.

Parameters

Name

Type

Description

$callback

callable

public eachSpread($callback):Illuminate\Support\Collection
Return type: Collection

Execute a callback over each nested chunk of items.

Parameters

Name

Type

Description

$callback

callable

public every($key, $operator = null, $value = null):bool

Determine if all items pass the given truth test.

Parameters

Name

Type

Description

$key

$operator

$value

public firstWhere($key, $operator = null, $value = null):void

Get the first item by the given key value pair.

Parameters

Name

Type

Description

$key

$operator

$value

public isNotEmpty():bool

Determine if the collection is not empty.

public mapSpread($callback):Illuminate\Support\Collection
Return type: Collection

Run a map over each nested chunk of items.

Parameters

Name

Type

Description

$callback

callable

public mapToGroups($callback):Illuminate\Support\Collection
Return type: Collection

Run a grouping map over the items.

Parameters

Name

Type

Description

$callback

callable

public flatMap($callback):Illuminate\Support\Collection
Return type: Collection

Map a collection and flatten the result by a single level.

Parameters

Name

Type

Description

$callback

callable

public mapInto($class):Illuminate\Support\Collection
Return type: Collection

Map the values into a new class.

Parameters

Name

Type

Description

$class

string

public min($callback = null):void

Get the min value of a given key.

Parameters

Name

Type

Description

$callback

public max($callback = null):void

Get the max value of a given key.

Parameters

Name

Type

Description

$callback

public forPage($page, $perPage):Illuminate\Support\Collection
Return type: Collection

"Paginate" the collection by slicing it into a smaller collection.

Parameters

Name

Type

Description

$page

int

$perPage

int

public partition($key, $operator = null, $value = null):Illuminate\Support\Collection
Return type: Collection

Partition the collection into two arrays using the given callback or key.

Parameters

Name

Type

Description

$key

$operator

$value

public sum($callback = null):void

Get the sum of the given values.

Parameters

Name

Type

Description

$callback

public where($key, $operator = null, $value = null):Illuminate\Support\Collection
Return type: Collection

Filter items by the given key value pair.

Parameters

Name

Type

Description

$key

$operator

$value

public whereStrict($key, $value):Illuminate\Support\Collection
Return type: Collection

Filter items by the given key value pair using strict comparison.

Parameters

Name

Type

Description

$key

string

$value

public whereIn($key, $values, $strict = false):Illuminate\Support\Collection
Return type: Collection

Filter items by the given key value pair.

Parameters

Name

Type

Description

$key

string

$values

$strict

bool

public whereInStrict($key, $values):Illuminate\Support\Collection
Return type: Collection

Filter items by the given key value pair using strict comparison.

Parameters

Name

Type

Description

$key

string

$values

public whereNotIn($key, $values, $strict = false):Illuminate\Support\Collection
Return type: Collection

Filter items by the given key value pair.

Parameters

Name

Type

Description

$key

string

$values

$strict

bool

public whereNotInStrict($key, $values):Illuminate\Support\Collection
Return type: Collection

Filter items by the given key value pair using strict comparison.

Parameters

Name

Type

Description

$key

string

$values

public pipe($callback):void

Pass the collection to the given callback and return the result.

Parameters

Name

Type

Description

$callback

callable

public reduce($callback, $initial = null):void

Reduce the collection to a single value.

Parameters

Name

Type

Description

$callback

callable

$initial

public reject($callback = true):Illuminate\Support\Collection
Return type: Collection

Create a collection of all elements that do not pass a given truth test.

Parameters

Name

Type

Description

$callback

public tap($callback):Illuminate\Support\Collection
Return type: Collection

Pass the collection to the given callback and then return it.

Parameters

Name

Type

Description

$callback

callable

public uniqueStrict($key = null):Illuminate\Support\Collection
Return type: Collection

Return only unique items from the collection array using strict comparison.

Parameters

Name

Type

Description

$key

public toArray():array

Get the collection of items as a plain array.

public jsonSerialize():array

Convert the object into something JSON serializable.

public toJson($options):string

Get the collection of items as JSON.

Parameters

Name

Type

Description

$options

int

public static proxy($method):void

Add a method to the list of proxied methods.

Parameters

Name

Type

Description

$method

string

public when($value = null, $callback = null, $default = null):Illuminate\Support\Collection
Return type: Collection

Apply the callback if the given "value" is (or resolves to) truthy.

Parameters

Name

Type

Description

$value

$callback

callable

$default

callable

public unless($value = null, $callback = null, $default = null):Illuminate\Support\Collection
Return type: Collection

Apply the callback if the given "value" is (or resolves to) falsy.

Parameters

Name

Type

Description

$value

$callback

callable

$default

callable

public static macro($name, $macro):void

Register a custom macro.

Parameters

Name

Type

Description

$name

string

$macro

public static hasMacro($name):bool

Checks if macro is registered.

Parameters

Name

Type

Description

$name

string

ServiceProvider

Abstract Model class

Namespace

Illuminate\Support

==

Carbon

Carbon

Namespace

Carbon

Properties
Name Type Description

year

yearIso

month

day

hour

minute

second

micro

microsecond

timestamp

englishDayOfWeek

shortEnglishDayOfWeek

englishMonth

shortEnglishMonth

milliseconds

millisecond

milli

week

isoWeek

weekYear

isoWeekYear

dayOfYear

age

offset

offsetMinutes

offsetHours

timezone

tz

Methods
public copy():Carbon\Carbon
Return type: Carbon

Get a copy of the instance.

public nowWithSameTz():Carbon\Carbon
Return type: Carbon

Returns a present instance in the same timezone.

public setDateTime($year, $month, $day, $hour, $minute, $second, $microseconds):Carbon\Carbon
Return type: Carbon

Set the date and time all together.

Parameters

Name

Type

Description

$year

int

$month

int

$day

int

$hour

int

$minute

int

$second

int

$microseconds

int

public setTimeFromTimeString($time):Carbon\Carbon
Return type: Carbon

Set the time by time string.

Parameters

Name

Type

Description

$time

string

public timezone($value):Carbon\Carbon
Return type: Carbon
Parameters

Name

Type

Description

$value

public tz($value = null):Carbon\Carbon
Return type: Carbon

Set the timezone or returns the timezone name if no arguments passed.

Parameters

Name

Type

Description

$value

public setDateFrom($date = null):Carbon\Carbon
Return type: Carbon

Set the year, month, and date for this instance to that of the passed instance.

Parameters

Name

Type

Description

$date

now if null

public setTimeFrom($date = null):Carbon\Carbon
Return type: Carbon

Set the hour, minute, second and microseconds for this instance to that of the passed instance.

Parameters

Name

Type

Description

$date

now if null

public static getDays():array

Get the days of the week

public static getWeekStartsAt():int

Get the first day of week

public static setWeekStartsAt($day):void
Parameters

Name

Type

Description

$day

week start day (or 'auto' to get the first day of week from Carbon::getLocale() culture).

public static getWeekEndsAt():int

Get the last day of week

public static setWeekEndsAt($day):void
Parameters

Name

Type

Description

$day

week end day (or 'auto' to get the day before the first day of week from Carbon::getLocale() culture).

public static getWeekendDays():array

Get weekend days

public static setWeekendDays($days):void
Parameters

Name

Type

Description

$days

array

public static hasRelativeKeywords($time):bool

Determine if a time string will produce a relative date.

Parameters

Name

Type

Description

$time

string

public static setUtf8($utf8):void
Parameters

Name

Type

Description

$utf8

bool

public formatLocalized($format):string

Format the instance with the current locale. You can set the current locale using setlocale() https://php.net/setlocale.

Parameters

Name

Type

Description

$format

string

public startOfDay():Carbon\Carbon
Return type: Carbon

Resets the time to 00:00:00 start of day

public endOfDay():Carbon\Carbon
Return type: Carbon

Resets the time to 23:59:59.999999 end of day

public startOfMonth():Carbon\Carbon
Return type: Carbon

Resets the date to the first day of the month and the time to 00:00:00

public endOfMonth():Carbon\Carbon
Return type: Carbon

Resets the date to end of the month and time to 23:59:59.999999

public startOfQuarter():Carbon\Carbon
Return type: Carbon

Resets the date to the first day of the quarter and the time to 00:00:00

public endOfQuarter():Carbon\Carbon
Return type: Carbon

Resets the date to end of the quarter and time to 23:59:59.999999

public startOfYear():Carbon\Carbon
Return type: Carbon

Resets the date to the first day of the year and the time to 00:00:00

public endOfYear():Carbon\Carbon
Return type: Carbon

Resets the date to end of the year and time to 23:59:59.999999

public startOfDecade():Carbon\Carbon
Return type: Carbon

Resets the date to the first day of the decade and the time to 00:00:00

public endOfDecade():Carbon\Carbon
Return type: Carbon

Resets the date to end of the decade and time to 23:59:59.999999

public startOfCentury():Carbon\Carbon
Return type: Carbon

Resets the date to the first day of the century and the time to 00:00:00

public endOfCentury():Carbon\Carbon
Return type: Carbon

Resets the date to end of the century and time to 23:59:59.999999

public startOfWeek($weekStartsAt = null):Carbon\Carbon
Return type: Carbon

Resets the date to the first day of week (defined in $weekStartsAt) and the time to 00:00:00

Parameters

Name

Type

Description

$weekStartsAt

int

optional start allow you to specify the day of week to use to start the week

public endOfWeek($weekEndsAt = null):Carbon\Carbon
Return type: Carbon

Resets the date to end of week (defined in $weekEndsAt) and time to 23:59:59.999999

Parameters

Name

Type

Description

$weekEndsAt

int

optional start allow you to specify the day of week to use to end the week

public startOfHour():Carbon\Carbon
Return type: Carbon

Modify to start of current hour, minutes and seconds become 0

public endOfHour():Carbon\Carbon
Return type: Carbon

Modify to end of current hour, minutes and seconds become 59

public startOfMinute():Carbon\Carbon
Return type: Carbon

Modify to start of current minute, seconds become 0

public endOfMinute():Carbon\Carbon
Return type: Carbon

Modify to end of current minute, seconds become 59

public eq($date):bool

Determines if the instance is equal to another

Parameters

Name

Type

Description

$date

public equalTo($date):bool

Determines if the instance is equal to another

Parameters

Name

Type

Description

$date

public ne($date):bool

Determines if the instance is not equal to another

Parameters

Name

Type

Description

$date

public notEqualTo($date):bool

Determines if the instance is not equal to another

Parameters

Name

Type

Description

$date

public gt($date):bool

Determines if the instance is greater (after) than another

Parameters

Name

Type

Description

$date

public greaterThan($date):bool

Determines if the instance is greater (after) than another

Parameters

Name

Type

Description

$date

public gte($date):bool

Determines if the instance is greater (after) than or equal to another

Parameters

Name

Type

Description

$date

public greaterThanOrEqualTo($date):bool

Determines if the instance is greater (after) than or equal to another

Parameters

Name

Type

Description

$date

public lt($date):bool

Determines if the instance is less (before) than another

Parameters

Name

Type

Description

$date

public lessThan($date):bool

Determines if the instance is less (before) than another

Parameters

Name

Type

Description

$date

public lte($date):bool

Determines if the instance is less (before) or equal to another

Parameters

Name

Type

Description

$date

public lessThanOrEqualTo($date):bool

Determines if the instance is less (before) or equal to another

Parameters

Name

Type

Description

$date

public between($date1, $date2, $equal = true):bool

Determines if the instance is between two others.

Parameters

Name

Type

Description

$date1

$date2

$equal

bool

Indicates if an equal to comparison should be done

public isWeekday():bool

Determines if the instance is a weekday.

public isWeekend():bool

Determines if the instance is a weekend day.

public isYesterday():bool

Determines if the instance is yesterday.

public isToday():bool

Determines if the instance is today.

public isTomorrow():bool

Determines if the instance is tomorrow.

public isFuture():bool

Determines if the instance is in the future, ie. greater (after) than now.

public isPast():bool

Determines if the instance is in the past, ie. less (before) than now.

public isLeapYear():bool

Determines if the instance is a leap year.

public isLongYear():bool

Determines if the instance is a long year (using calendar year).

public isSameAs($format, $date = null):bool

Compares the formatted values of the two dates.

Parameters

Name

Type

Description

$format

string

date formats to compare.

$date

instance to compare with or null to use current day.

public isSameQuarter($date = null, $ofSameYear = true):bool

Checks if the passed in date is in the same quarter as the instance quarter (and year if needed).

Parameters

Name

Type

Description

$date

The instance to compare with or null to use current day.

$ofSameYear

bool

Check if it is the same month in the same year.

public isSameMonth($date = null, $ofSameYear = true):bool

Checks if the passed in date is in the same month as the instance´s month.

Parameters

Name

Type

Description

$date

The instance to compare with or null to use the current date.

$ofSameYear

bool

Check if it is the same month in the same year.

public isDayOfWeek($dayOfWeek):bool

Checks if this day is a specific day of the week.

Parameters

Name

Type

Description

$dayOfWeek

int

public isBirthday($date = null):bool

Check if its the birthday. Compares the date/month values of the two dates.

Parameters

Name

Type

Description

$date

The instance to compare with or null to use current day.

public isLastOfMonth():bool

Check if today is the last day of the Month

public static hasFormat($date, $format):bool

Checks if the (date)time string is in a given format.

Parameters

Name

Type

Description

$date

string

$format

string

public toDateString():string

Format the instance as date

public toFormattedDateString():string

Format the instance as a readable date

public toTimeString($unitPrecision = &quot;second&quot;):string

Format the instance as time

Parameters

Name

Type

Description

$unitPrecision

string

public toDateTimeString($unitPrecision = &quot;second&quot;):string

Format the instance as date and time

Parameters

Name

Type

Description

$unitPrecision

string

public toDayDateTimeString():string

Format the instance with day, date and time

public toAtomString():string

Format the instance as ATOM

public toCookieString():string

Format the instance as COOKIE

public toIso8601String():string

Format the instance as ISO8601

public toRfc822String():string

Format the instance as RFC822

public toIso8601ZuluString($unitPrecision = &quot;second&quot;):string

Convert the instance to UTC and return as Zulu ISO8601

Parameters

Name

Type

Description

$unitPrecision

string

public toRfc850String():string

Format the instance as RFC850

public toRfc1036String():string

Format the instance as RFC1036

public toRfc1123String():string

Format the instance as RFC1123

public toRfc2822String():string

Format the instance as RFC2822

public toRfc3339String($extended = false):string

Format the instance as RFC3339

Parameters

Name

Type

Description

$extended

bool

public toRssString():string

Format the instance as RSS

public toW3cString():string

Format the instance as W3C

public toRfc7231String():string

Format the instance as RFC7231

public toArray():array

Get default array representation.

public static resetToStringFormat():void

Reset the format used to the default when type juggling a Carbon instance to a string

public static setToStringFormat($format):void
Parameters

Name

Type

Description

$format

public static instance($date):Carbon\Carbon
Return type: Carbon

Create a Carbon instance from a DateTime one.

Parameters

Name

Type

Description

$date

public static parse($time = null, $tz = null):Carbon\Carbon
Return type: Carbon

Create a carbon instance from a string.

Parameters

Name

Type

Description

$time

$tz

public static now($tz = null):Carbon\Carbon
Return type: Carbon

Get a Carbon instance for the current date and time.

Parameters

Name

Type

Description

$tz

public static today($tz = null):Carbon\Carbon
Return type: Carbon

Create a Carbon instance for today.

Parameters

Name

Type

Description

$tz

public static tomorrow($tz = null):Carbon\Carbon
Return type: Carbon

Create a Carbon instance for tomorrow.

Parameters

Name

Type

Description

$tz

public static yesterday($tz = null):Carbon\Carbon
Return type: Carbon

Create a Carbon instance for yesterday.

Parameters

Name

Type

Description

$tz

public static maxValue():Carbon\Carbon
Return type: Carbon

Create a Carbon instance for the greatest supported date.

public static minValue():Carbon\Carbon
Return type: Carbon

Create a Carbon instance for the lowest supported date.

public static create($year, $month = 1, $day = 1, $hour, $minute, $second, $tz = null):Carbon\Carbon
Return type: Carbon

Create a new Carbon instance from a specific date and time.

Parameters

Name

Type

Description

$year

$month

int

$day

int

$hour

int

$minute

int

$second

int

$tz

public static createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null):Carbon\Carbon
Return type: Carbon

Create a new safe Carbon instance from a specific date and time.

Parameters

Name

Type

Description

$year

int

$month

int

$day

int

$hour

int

$minute

int

$second

int

$tz

public static createFromDate($year = null, $month = null, $day = null, $tz = null):Carbon\Carbon
Return type: Carbon

Create a Carbon instance from just a date. The time portion is set to now.

Parameters

Name

Type

Description

$year

int

$month

int

$day

int

$tz

public static createMidnightDate($year = null, $month = null, $day = null, $tz = null):Carbon\Carbon
Return type: Carbon

Create a Carbon instance from just a date. The time portion is set to midnight.

Parameters

Name

Type

Description

$year

int

$month

int

$day

int

$tz

public static createFromTime($hour, $minute, $second, $tz = null):Carbon\Carbon
Return type: Carbon

Create a Carbon instance from just a time. The date portion is set to today.

Parameters

Name

Type

Description

$hour

int

$minute

int

$second

int

$tz

public static createFromTimeString($time, $tz = null):Carbon\Carbon
Return type: Carbon

Create a Carbon instance from a time string. The date portion is set to today.

Parameters

Name

Type

Description

$time

string

$tz

public diffInYears($date = null, $absolute = true):int

Get the difference in years

Parameters

Name

Type

Description

$date

$absolute

bool

Get the absolute of the difference

public diffInMonths($date = null, $absolute = true):int

Get the difference in months rounded down.

Parameters

Name

Type

Description

$date

$absolute

bool

Get the absolute of the difference

public diffInWeeks($date = null, $absolute = true):int

Get the difference in weeks rounded down.

Parameters

Name

Type

Description

$date

$absolute

bool

Get the absolute of the difference

public diffInDays($date = null, $absolute = true):int

Get the difference in days rounded down.

Parameters

Name

Type

Description

$date

$absolute

bool

Get the absolute of the difference

public diffInWeekdays($date = null, $absolute = true):int

Get the difference in weekdays rounded down.

Parameters

Name

Type

Description

$date

$absolute

bool

Get the absolute of the difference

public diffInWeekendDays($date = null, $absolute = true):int

Get the difference in weekend days using a filter rounded down.

Parameters

Name

Type

Description

$date

$absolute

bool

Get the absolute of the difference

public diffInHours($date = null, $absolute = true):int

Get the difference in hours rounded down.

Parameters

Name

Type

Description

$date

$absolute

bool

Get the absolute of the difference

public diffInRealHours($date = null, $absolute = true):int

Get the difference in hours rounded down using timestamps.

Parameters

Name

Type

Description

$date

$absolute

bool

Get the absolute of the difference

public diffInMinutes($date = null, $absolute = true):int

Get the difference in minutes rounded down.

Parameters

Name

Type

Description

$date

$absolute

bool

Get the absolute of the difference

public diffInRealMinutes($date = null, $absolute = true):int

Get the difference in minutes rounded down using timestamps.

Parameters

Name

Type

Description

$date

$absolute

bool

Get the absolute of the difference

public diffInSeconds($date = null, $absolute = true):int

Get the difference in seconds rounded down.

Parameters

Name

Type

Description

$date

$absolute

bool

Get the absolute of the difference

public diffInRealSeconds($date = null, $absolute = true):int

Get the difference in seconds using timestamps.

Parameters

Name

Type

Description

$date

$absolute

bool

Get the absolute of the difference

public secondsSinceMidnight():int

The number of seconds since midnight.

public secondsUntilEndOfDay():int

The number of seconds until 23:59:59.

public diffForHumans($other = null, $syntax = null, $short = false, $parts = 1, $options = null):string

Get the difference in a human readable format in the current locale from current instance to an other instance given (or now if null given).

Parameters

Name

Type

Description

$other

if array passed, will be used as parameters array, see $syntax below; if null passed, now will be used as comparison reference; if any other type, it will be converted to date and used as reference.

$syntax

if array passed, parameters will be extracted from it, the array may contains: - 'syntax' entry (see below) - 'short' entry (see below) - 'parts' entry (see below) - 'options' entry (see below) - 'skip' entry, list of units to skip (array of strings or a single string, ` it can be the unit name (singular or plural) or its shortcut ` (y, m, w, d, h, min, s, ms, µs). - 'aUnit' entry, prefer "an hour" over "1 hour" if true - 'join' entry determines how to join multiple parts of the string ` - if $join is a string, it’s used as a joiner glue ` - if $join is a callable/closure, it get the list of string and should return a string ` - if $join is an array, the first item will be the default glue, and the second item ` will be used instead of the glue for the last item ` - if $join is true, it will be guessed from the locale ('list' translation file entry) ` - if $join is missing, a space will be used as glue - 'other' entry (see above) - 'minimumUnit' entry determines the smallest unit of time to display can be long or ` short form of the units, e.g. 'hour' or 'h' (default value: s) if int passed, it add modifiers: Possible values: - CarbonInterface::DIFF_ABSOLUTE no modifiers - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier Default value: CarbonInterface::DIFF_ABSOLUTE

$short

bool

displays short format of time units

$parts

int

maximum number of parts to display (default value: 1: single unit)

$options

int

human diff options

public static macro($name, $macro):void

Register a custom macro.

Parameters

Name

Type

Description

$name

string

$macro

public static hasMacro($name):bool

Checks if macro is registered globally.

Parameters

Name

Type

Description

$name

string

public static getMidDayAt():int

get midday/noon hour

public static setMidDayAt($hour):void
Parameters

Name

Type

Description

$hour

int

midday hour

public midDay():Carbon\Carbon
Return type: Carbon

Modify to midday, default to self::$midDayAt

Return type: Carbon

Modify to the next occurrence of a given modifier such as a day of the week. If no modifier is provided, modify to the next occurrence of the current day of the week. Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.

Parameters

Name

Type

Description

$modifier

public nextWeekday():Carbon\Carbon
Return type: Carbon

Go forward to the next weekday.

public previousWeekday():Carbon\Carbon
Return type: Carbon

Go backward to the previous weekday.

public nextWeekendDay():Carbon\Carbon
Return type: Carbon

Go forward to the next weekend day.

public previousWeekendDay():Carbon\Carbon
Return type: Carbon

Go backward to the previous weekend day.

Return type: Carbon

Modify to the previous occurrence of a given modifier such as a day of the week. If no dayOfWeek is provided, modify to the previous occurrence of the current day of the week. Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.

Parameters

Name

Type

Description

$modifier

public firstOfMonth($dayOfWeek = null):Carbon\Carbon
Return type: Carbon

Modify to the first occurrence of a given day of the week in the current month. If no dayOfWeek is provided, modify to the first day of the current month. Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.

Parameters

Name

Type

Description

$dayOfWeek

int

public lastOfMonth($dayOfWeek = null):Carbon\Carbon
Return type: Carbon

Modify to the last occurrence of a given day of the week in the current month. If no dayOfWeek is provided, modify to the last day of the current month. Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.

Parameters

Name

Type

Description

$dayOfWeek

int

public nthOfMonth($nth, $dayOfWeek):void

Modify to the given occurrence of a given day of the week in the current month. If the calculated occurrence is outside the scope of the current month, then return false and no modifications are made.

Parameters

Name

Type

Description

$nth

int

$dayOfWeek

int

public firstOfQuarter($dayOfWeek = null):Carbon\Carbon
Return type: Carbon

Modify to the first occurrence of a given day of the week in the current quarter. If no dayOfWeek is provided, modify to the first day of the current quarter. Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.

Parameters

Name

Type

Description

$dayOfWeek

int

day of the week default null

public lastOfQuarter($dayOfWeek = null):Carbon\Carbon
Return type: Carbon

Modify to the last occurrence of a given day of the week in the current quarter. If no dayOfWeek is provided, modify to the last day of the current quarter. Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.

Parameters

Name

Type

Description

$dayOfWeek

int

day of the week default null

public nthOfQuarter($nth, $dayOfWeek):void

Modify to the given occurrence of a given day of the week in the current quarter. If the calculated occurrence is outside the scope of the current quarter, then return false and no modifications are made.

Parameters

Name

Type

Description

$nth

int

$dayOfWeek

int

public firstOfYear($dayOfWeek = null):Carbon\Carbon
Return type: Carbon

Modify to the first occurrence of a given day of the week in the current year. If no dayOfWeek is provided, modify to the first day of the current year. Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.

Parameters

Name

Type

Description

$dayOfWeek

int

day of the week default null

public lastOfYear($dayOfWeek = null):Carbon\Carbon
Return type: Carbon

Modify to the last occurrence of a given day of the week in the current year. If no dayOfWeek is provided, modify to the last day of the current year. Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.

Parameters

Name

Type

Description

$dayOfWeek

int

day of the week default null

public nthOfYear($nth, $dayOfWeek):void

Modify to the given occurrence of a given day of the week in the current year. If the calculated occurrence is outside the scope of the current year, then return false and no modifications are made.

Parameters

Name

Type

Description

$nth

int

$dayOfWeek

int

public average($date = null):Carbon\Carbon
Return type: Carbon

Modify the current instance to the average of a given instance (default now) and the current instance (second-precision).

Parameters

Name

Type

Description

$date

public closest($date1, $date2):Carbon\Carbon
Return type: Carbon

Get the closest date from the instance (second-precision).

Parameters

Name

Type

Description

$date1

$date2

public farthest($date1, $date2):Carbon\Carbon
Return type: Carbon

Get the farthest date from the instance (second-precision).

Parameters

Name

Type

Description

$date1

$date2

public min($date = null):Carbon\Carbon
Return type: Carbon

Get the minimum instance between a given instance (default now) and the current instance.

Parameters

Name

Type

Description

$date

public minimum($date = null):Carbon\Carbon
Return type: Carbon

Get the minimum instance between a given instance (default now) and the current instance.

Parameters

Name

Type

Description

$date

public max($date = null):Carbon\Carbon
Return type: Carbon

Get the maximum instance between a given instance (default now) and the current instance.

Parameters

Name

Type

Description

$date

public maximum($date = null):Carbon\Carbon
Return type: Carbon

Get the maximum instance between a given instance (default now) and the current instance.

Parameters

Name

Type

Description

$date

public static useMonthsOverflow($monthsOverflow = true):void
Parameters

Name

Type

Description

$monthsOverflow

bool

public static resetMonthsOverflow():void
public static shouldOverflowMonths():bool

Get the month overflow global behavior (can be overridden in specific instances).

public static useYearsOverflow($yearsOverflow = true):void
Parameters

Name

Type

Description

$yearsOverflow

bool

public static resetYearsOverflow():void
public static shouldOverflowYears():bool

Get the month overflow global behavior (can be overridden in specific instances).

public static setHumanDiffOptions($humanDiffOptions):void
Parameters

Name

Type

Description

$humanDiffOptions

int

public static enableHumanDiffOption($humanDiffOption):void
Parameters

Name

Type

Description

$humanDiffOption

int

public static disableHumanDiffOption($humanDiffOption):void
Parameters

Name

Type

Description

$humanDiffOption

int

public static getHumanDiffOptions():int

Return default humanDiff() options (merged flags as integer).

public serialize():string

Return a serialized string of the instance.

public static fromSerialized($value):Carbon\Carbon
Return type: Carbon

Create an instance from a serialized string.

Parameters

Name

Type

Description

$value

string

public jsonSerialize():void

Prepare the object for JSON serialization.

public static serializeUsing($callback):void
Parameters

Name

Type

Description

$callback

callable

public static createFromTimestamp($timestamp, $tz = null):Carbon\Carbon
Return type: Carbon

Create a Carbon instance from a timestamp and set the timezone (use default one if not specified).

Parameters

Name

Type

Description

$timestamp

$tz

public static createFromTimestampUTC($timestamp):Carbon\Carbon
Return type: Carbon

Create a Carbon instance from an timestamp keeping the timezone to UTC.

Parameters

Name

Type

Description

$timestamp

public static createFromTimestampMs($timestamp, $tz = null):Carbon\Carbon
Return type: Carbon

Create a Carbon instance from a timestamp in milliseconds.

Parameters

Name

Type

Description

$timestamp

$tz

public timestamp($unixTimestamp):Carbon\Carbon
Return type: Carbon

Set the instance's timestamp.

Parameters

Name

Type

Description

$unixTimestamp

public isSunday():bool

Checks if the instance day is sunday.

public isMonday():bool

Checks if the instance day is monday.

public isTuesday():bool

Checks if the instance day is tuesday.

public isWednesday():bool

Checks if the instance day is wednesday.

public isThursday():bool

Checks if the instance day is thursday.

public isFriday():bool

Checks if the instance day is friday.

public isSaturday():bool

Checks if the instance day is saturday.

public isSameYear($date = null):bool

Checks if the given date is in the same year as the instance. If null passed, compare to now (with the same timezone).

Parameters

Name

Type

Description

$date = null

public isCurrentYear():bool

Checks if the instance is in the same year as the current moment.

public isNextYear():bool

Checks if the instance is in the same year as the current moment next year.

public isLastYear():bool

Checks if the instance is in the same year as the current moment last year.

public isNextWeek():bool

Checks if the instance is in the same week as the current moment next week.

public isLastWeek():bool

Checks if the instance is in the same week as the current moment last week.

public isSameDay($date = null):bool

Checks if the given date is in the same day as the instance. If null passed, compare to now (with the same timezone).

Parameters

Name

Type

Description

$date = null

public isCurrentMonth():bool

Checks if the instance is in the same month as the current moment.

public isNextMonth():bool

Checks if the instance is in the same month as the current moment next month.

public isLastMonth():bool

Checks if the instance is in the same month as the current moment last month.

public isCurrentQuarter():bool

Checks if the instance is in the same quarter as the current moment.

public isNextQuarter():bool

Checks if the instance is in the same quarter as the current moment next quarter.

public isLastQuarter():bool

Checks if the instance is in the same quarter as the current moment last quarter.

public year($value):Carbon

Set current instance year to the given value.

Parameters

Name

Type

Description

$value

int

public month($value):Carbon

Set current instance month to the given value.

Parameters

Name

Type

Description

$value

int

public day($value):Carbon

Set current instance day to the given value.

Parameters

Name

Type

Description

$value

int

public hour($value):Carbon

Set current instance hour to the given value.

Parameters

Name

Type

Description

$value

int

public minute($value):Carbon

Set current instance minute to the given value.

Parameters

Name

Type

Description

$value

int

public second($value):Carbon

Set current instance second to the given value.

Parameters

Name

Type

Description

$value

int

public addYears($value = 1):Carbon

Add years (the $value count passed in) to the instance (using date interval).

Parameters

Name

Type

Description

$value = 1

int

public addYear():Carbon

Add one year to the instance (using date interval).

public subYears($value = 1):Carbon

Sub years (the $value count passed in) to the instance (using date interval).

Parameters

Name

Type

Description

$value = 1

int

public subYear():Carbon

Sub one year to the instance (using date interval).

public addYearsWithOverflow($value = 1):Carbon

Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.

Parameters

Name

Type

Description

$value = 1

int

public addYearWithOverflow():Carbon

Add one year to the instance (using date interval) with overflow explicitly allowed.

public subYearsWithOverflow($value = 1):Carbon

Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.

Parameters

Name

Type

Description

$value = 1

int

public subYearWithOverflow():Carbon

Sub one year to the instance (using date interval) with overflow explicitly allowed.

public addYearsNoOverflow($value = 1):Carbon

Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.

Parameters

Name

Type

Description

$value = 1

int

public addYearNoOverflow():Carbon

Add one year to the instance (using date interval) with overflow explicitly forbidden.

public subYearsNoOverflow($value = 1):Carbon

Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.

Parameters

Name

Type

Description

$value = 1

int

public subYearNoOverflow():Carbon

Sub one year to the instance (using date interval) with overflow explicitly forbidden.

public addMonths($value = 1):Carbon

Add months (the $value count passed in) to the instance (using date interval).

Parameters

Name

Type

Description

$value = 1

int

public addMonth():Carbon

Add one month to the instance (using date interval).

public subMonths($value = 1):Carbon

Sub months (the $value count passed in) to the instance (using date interval).

Parameters

Name

Type

Description

$value = 1

int

public subMonth():Carbon

Sub one month to the instance (using date interval).

public addMonthsWithOverflow($value = 1):Carbon

Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.

Parameters

Name

Type

Description

$value = 1

int

public addMonthWithOverflow():Carbon

Add one month to the instance (using date interval) with overflow explicitly allowed.

public subMonthsWithOverflow($value = 1):Carbon

Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.

Parameters

Name

Type

Description

$value = 1

int

public subMonthWithOverflow():Carbon

Sub one month to the instance (using date interval) with overflow explicitly allowed.

public addMonthsNoOverflow($value = 1):Carbon

Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.

Parameters

Name

Type

Description

$value = 1

int

public addMonthNoOverflow():Carbon

Add one month to the instance (using date interval) with overflow explicitly forbidden.

public subMonthsNoOverflow($value = 1):Carbon

Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.

Parameters

Name

Type

Description

$value = 1

int

public subMonthNoOverflow():Carbon

Sub one month to the instance (using date interval) with overflow explicitly forbidden.

public addDays($value = 1):Carbon

Add days (the $value count passed in) to the instance (using date interval).

Parameters

Name

Type

Description

$value = 1

int

public addDay():Carbon

Add one day to the instance (using date interval).

public subDays($value = 1):Carbon

Sub days (the $value count passed in) to the instance (using date interval).

Parameters

Name

Type

Description

$value = 1

int

public subDay():Carbon

Sub one day to the instance (using date interval).

public addHours($value = 1):Carbon

Add hours (the $value count passed in) to the instance (using date interval).

Parameters

Name

Type

Description

$value = 1

int

public addHour():Carbon

Add one hour to the instance (using date interval).

public subHours($value = 1):Carbon

Sub hours (the $value count passed in) to the instance (using date interval).

Parameters

Name

Type

Description

$value = 1

int

public subHour():Carbon

Sub one hour to the instance (using date interval).

public addMinutes($value = 1):Carbon

Add minutes (the $value count passed in) to the instance (using date interval).

Parameters

Name

Type

Description

$value = 1

int

public addMinute():Carbon

Add one minute to the instance (using date interval).

public subMinutes($value = 1):Carbon

Sub minutes (the $value count passed in) to the instance (using date interval).

Parameters

Name

Type

Description

$value = 1

int

public subMinute():Carbon

Sub one minute to the instance (using date interval).

public addSeconds($value = 1):Carbon

Add seconds (the $value count passed in) to the instance (using date interval).

Parameters

Name

Type

Description

$value = 1

int

public addSecond():Carbon

Add one second to the instance (using date interval).

public subSeconds($value = 1):Carbon

Sub seconds (the $value count passed in) to the instance (using date interval).

Parameters

Name

Type

Description

$value = 1

int

public subSecond():Carbon

Sub one second to the instance (using date interval).

public addCenturies($value = 1):Carbon

Add centuries (the $value count passed in) to the instance (using date interval).

Parameters

Name

Type

Description

$value = 1

int

public addCentury():Carbon

Add one century to the instance (using date interval).

public subCenturies($value = 1):Carbon

Sub centuries (the $value count passed in) to the instance (using date interval).

Parameters

Name

Type

Description

$value = 1

int

public subCentury():Carbon

Sub one century to the instance (using date interval).

public addQuarters($value = 1):Carbon

Add quarters (the $value count passed in) to the instance (using date interval).

Parameters

Name

Type

Description

$value = 1

int

public addQuarter():Carbon

Add one quarter to the instance (using date interval).

public subQuarters($value = 1):Carbon

Sub quarters (the $value count passed in) to the instance (using date interval).

Parameters

Name

Type

Description

$value = 1

int

public subQuarter():Carbon

Sub one quarter to the instance (using date interval).

public addWeeks($value = 1):Carbon

Add weeks (the $value count passed in) to the instance (using date interval).

Parameters

Name

Type

Description

$value = 1

int

public addWeek():Carbon

Add one week to the instance (using date interval).

public subWeeks($value = 1):Carbon

Sub weeks (the $value count passed in) to the instance (using date interval).

Parameters

Name

Type

Description

$value = 1

int

public subWeek():Carbon

Sub one week to the instance (using date interval).

public addWeekdays($value = 1):Carbon

Add weekdays (the $value count passed in) to the instance (using date interval).

Parameters

Name

Type

Description

$value = 1

int

public addWeekday():Carbon

Add one weekday to the instance (using date interval).

public subWeekdays($value = 1):Carbon

Sub weekdays (the $value count passed in) to the instance (using date interval).

Parameters

Name

Type

Description

$value = 1

int

public subWeekday():Carbon

Sub one weekday to the instance (using date interval).

public addRealSeconds($value = 1):Carbon

Add seconds (the $value count passed in) to the instance (using timestamp).

Parameters

Name

Type

Description

$value = 1

int

public addRealSecond():Carbon

Add one second to the instance (using timestamp).

public subRealSeconds($value = 1):Carbon

Sub seconds (the $value count passed in) to the instance (using timestamp).

Parameters

Name

Type

Description

$value = 1

int

public subRealSecond():Carbon

Sub one second to the instance (using timestamp).

public addRealMinutes($value = 1):Carbon

Add minutes (the $value count passed in) to the instance (using timestamp).

Parameters

Name

Type

Description

$value = 1

int

public addRealMinute():Carbon

Add one minute to the instance (using timestamp).

public subRealMinutes($value = 1):Carbon

Sub minutes (the $value count passed in) to the instance (using timestamp).

Parameters

Name

Type

Description

$value = 1

int

public subRealMinute():Carbon

Sub one minute to the instance (using timestamp).

public addRealHours($value = 1):Carbon

Add hours (the $value count passed in) to the instance (using timestamp).

Parameters

Name

Type

Description

$value = 1

int

public addRealHour():Carbon

Add one hour to the instance (using timestamp).

public subRealHours($value = 1):Carbon

Sub hours (the $value count passed in) to the instance (using timestamp).

Parameters

Name

Type

Description

$value = 1

int

public subRealHour():Carbon

Sub one hour to the instance (using timestamp).

Database

Eloquent

Model

Abstract Model class

Namespace

Illuminate\Database\Eloquent

Collection

Abstract Model class

Namespace

Illuminate\Database\Eloquent

Component

HttpFoundation

Response

Abstract Model class

Namespace

Symfony\Component\HttpFoundation