Configuration of item images
Plenty\Legacy\Models\Item
Type | Name | Description |
---|---|---|
int | cdnUrl | |
int | maxAge | |
int | imageExportPos | |
int | defaultExport | |
int | ftpImport | |
int | ftpImportMatching | |
int | neckermannExport | |
int | attributeImageWidth | |
int | attributeImageHeight | |
array | name | |
array | placeholder | |
array | sizes | |
array | aliases | |
array | legacyPreviousSizes |
public toArray()
Returns this model as an array.
foo
Plenty\Legacy\Repositories\Item\SalesPrice
public search(SalesPriceSearchRequest $request):SalesPriceSearchResponse
SalesPriceSearchRequest | $request |
public searchAll(SalesPriceSearchRequest $request):array
SalesPriceSearchRequest | $request |
To be written...
Plenty\Legacy\Services\Item\Variation
public getQuantity():void
public setQuantity($quantity):DetectSalesPriceService
$quantity |
public getCurrency():void
public setCurrency($currency):DetectSalesPriceService
$currency |
public getPlentyId():void
public setPlentyId($plentyId):DetectSalesPriceService
$plentyId |
public getOrderReferrer():void
public setOrderReferrer($orderReferrer):DetectSalesPriceService
$orderReferrer |
public getCustomerClass():void
public setCustomerClass($customerClass):DetectSalesPriceService
$customerClass |
public getType():void
public setType($type):DetectSalesPriceService
$type |
public getCountryOfDelivery():void
public setCountryOfDelivery($countryOfDelivery):DetectSalesPriceService
$countryOfDelivery |
public getAccountType():void
public setAccountType($accountType):DetectSalesPriceService
$accountType |
public getAccountId():void
public setAccountId($accountId):DetectSalesPriceService
$accountId |
public detect():void
To be written...
Plenty\Legacy\Services\Item\Variation
public getUnitPrice(float $lot, float $price, string $unit):array
float | $lot | |
float | $price | |
string | $unit |
The contract for the logger.
Plenty\Log\Contracts
public report(string $code, $additionalInfo = null):void
Report information.
string | $code | |
$additionalInfo |
public debug(string $code, $additionalInfo = null):void
Detailed debug information.
string | $code | |
$additionalInfo |
public info(string $code, $additionalInfo = null):void
Interesting events.
string | $code | |
$additionalInfo |
public notice(string $code, $additionalInfo = null):void
Normal but significant events.
string | $code | |
$additionalInfo |
public warning(string $code, $additionalInfo = null):void
Exceptional occurrences that are not errors.
string | $code | |
$additionalInfo |
public error(string $code, $additionalInfo = null):void
Runtime errors that do not require immediate action but should typically be logged and monitored.
string | $code | |
$additionalInfo |
public critical(string $code, $additionalInfo = null):void
Critical conditions.
string | $code | |
$additionalInfo |
public alert(string $code, $additionalInfo = null):void
Action must be taken immediately.
string | $code | |
$additionalInfo |
public emergency($code, $additionalInfo = null):void
System is unusable.
$code | ||
$additionalInfo |
public logException(Exception $exception, int $traceDepth = 3):void
Log exceptions.
Exception | $exception | |
int | $traceDepth | The depth of the stack trace to be logged. Default is 3. |
public setReferenceType(string $referenceType):LoggerContract
The reference type.
string | $referenceType |
public setReferenceValue($referenceValue):LoggerContract
The reference value.
$referenceValue |
public addReference(string $referenceType, int $referenceValue):LoggerContract
Add reference.
string | $referenceType | |
int | $referenceValue |
public addPlaceholder(string $placeholderName, $placeholderValue):LoggerContract
Add code placeholder.
string | $placeholderName | |
$placeholderValue |
Class ReferenceTypeException
Plenty\Log\Exceptions
public __construct(string $message, int $code, Exception $previous = null):void
string | $message | |
int | $code | |
Exception | $previous |
The log entity model
Plenty\Log\Models
Type | Name | Description |
---|---|---|
string | id | The ID of the log entry |
string | createdAt | The date when the log entry was created |
string | integration | The integration key used for the log entry. Used as a first level allocation. |
string | identifier | The identifier used for the log entry. Used as a second level allocation. |
string | code | 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. |
string | referenceType | Deprecated field, see the references field instead. |
referenceValue | Deprecated field, see the references field instead. |
|
string | level | 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. | |
string | callerFunction | |
int | callerLine | |
array | references | All the reference types and values correlated with this log entry. |
public toArray()
Returns this model as an array.
Register log reference types.
Plenty\Log\Services
public add(array $referenceTypes):void
Use this method to add reference types.
array | $referenceTypes |
Contract for logs.
Plenty\Log\Search\Contracts
public search(int $page = 1, int $itemsPerPage = 50, array $filters = [], string $sortBy = "createdAt", string $sortOrder = "desc", array $with = []):FilteredPaginatedResult
Search logs with the given filters.
int | $page | |
int | $itemsPerPage | |
array | $filters | |
string | $sortBy | |
string | $sortOrder | |
array | $with |
public get($id):Log
Get log entry by id.
$id |
The main application
Plenty\Plugin
public register(string $providerClassName):void
Register a service provider with the application.
string | $providerClassName | the classname with namespace of the provider |
public bind(string $abstract, string $concrete = null, bool $shared = false):void
Register a binding with the container.
string | $abstract | |
string | $concrete | |
bool | $shared |
public singleton(string $abstract, string $concrete = null):void
Register a shared binding in the container.
string | $abstract | |
string | $concrete |
public make(string $abstract, array $parameters = []):void
string | $abstract | |
array | $parameters |
public makeWith(string $abstract, array $parameters = []):void
string | $abstract | |
array | $parameters |
public abort(int $code, string $message = "", array $headers = []):void
Throw an HttpException with the given data.
int | $code | |
string | $message | |
array | $headers |
public getWebstoreId():int
Returns current webstoreId
public getPlentyId():int
public isAdminPreview():bool
public isTemplateSafeMode():bool
public isBackendRequest():bool
public getPluginSetId():int
public getUrlPath(string $pluginName = ""):string
Returns the URL to the plugin resources
string | $pluginName |
public getCdnDomain():string
Returns the URL from the cdn
public getPlentyHash():string
Returns the plentyHash
caching repository
Plenty\Plugin
public has(string $key):bool
Determine if an item exists in the cache.
string | $key |
public get(string $key, $default = null):void
Retrieve an item from the cache by key.
string | $key | |
$default |
public many(array $keys):array
Retrieve multiple items from the cache by key.
array | $keys |
public pull(string $key, $default = null):void
Retrieve an item from the cache and delete it.
string | $key | |
$default |
public put(string $key, $value, int $minutes = null):void
Store an item in the cache.
string | $key | |
$value | ||
int | $minutes |
public putMany(array $values, int $minutes):void
Store multiple items in the cache for a given number of minutes.
array | $values | |
int | $minutes |
public add(string $key, $value, int $minutes):bool
Store an item in the cache if the key does not exist.
string | $key | |
$value | ||
int | $minutes |
public remember(string $key, int $minutes, callable $callback):void
Get an item from the cache, or store the default value.
string | $key | |
int | $minutes | |
callable | $callback |
public forget(string $key):bool
Remove an item from the cache.
string | $key |
public static getPrefix():string
configuration repository
Plenty\Plugin
public has(string $key):bool
Determine if the given configuration value exists.
string | $key |
public get(string $key, $default = null):mixed
Get the specified configuration value.
string | $key | |
$default |
public set(string $key, $value = null):void
Set a given configuration value.
string | $key | |
$value |
public prepend(string $key, $value):void
Prepend a value onto an array configuration value.
string | $key | |
$value |
public push(string $key, $value):void
Push a value onto an array configuration value.
string | $key | |
$value |
public static getPrefix():string
Controller
Plenty\Plugin
public __construct():void
Controller constructor.
Data Exchange service provider
Plenty\Plugin
public getApplication():Application
public getEventDispatcher():Dispatcher
Middleware
Plenty\Plugin
public before(Request $request):void
Request | $request |
public after(Request $request, Response $response):Response
Request | $request | |
Response | $response |
Route service provider
Plenty\Plugin
public getApplication():Application
public getEventDispatcher():Dispatcher
Service provider for plugins
Plenty\Plugin
public addGlobalMiddleware(string $middleware):void
Add a new middleware to end of the stack if it does not already exist.
string | $middleware |
public getApplication():Application
public getEventDispatcher():Dispatcher
session repository
Plenty\Plugin
public has(string $key):bool
Determine if the given session value exists.
string | $key |
public get(string $key, $default = null):void
Get the specified session value.
string | $key | |
$default |
public set(string $key, $value = null):void
Set a given session value.
string | $key | |
$value |
public prepend(string $key, $value):void
Prepend a value onto an array session value.
string | $key | |
$value |
public push(string $key, $value):void
Push a value onto an array session value.
string | $key | |
$value |
public static getPrefix():string
Dummy Attribute Class
Plenty\Validation
public getAttributeName():string
Returns the attribute's name
public setAttributeName(string $attributeName):Validation
Sets the attribute's name
string | $attributeName |
public accepted():Validation
The field under validation must be yes, on, 1, or true. This is useful for validating "Terms of Service" acceptance.
public activeUrl():Validation
The field under validation must be a valid URL according to the checkdnsrr PHP function.
public dateAfter(string $fieldNameOrTimeStr):Validation
The field under validation must be a value after a given date. The dates will be passed into the strtotime PHP function.
string | $fieldNameOrTimeStr |
public alphabetic():Validation
The field under validation must be entirely alphabetic characters.
public alphaDash():Validation
The field under validation may have alpha-numeric characters, as well as dashes and underscores.
public alphaNum():Validation
The field under validation must be entirely alpha-numeric characters.
public isArray():Validation
The field under validation must be a PHP array.
public dateBefore(string $fieldNameOrTimeStr):Validation
The field under validation must be a value preceding the given date. The dates will be passed into the PHP strtotime function.
string | $fieldNameOrTimeStr |
public between(int $min, int $max):Validation
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.
int | $min | |
int | $max |
public boolean():Validation
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():Validation
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():Validation
The field under validation must be a valid date according to the strtotime PHP function.
public present():Validation
Validate that an attribute exists even if not filled.
public dateFormat(string $format):Validation
The field under validation must match the given format. The format will be evaluated using the PHP date_parse_from_format function.
string | $format |
public different(string $fieldName):Validation
The field under validation must have a different value than field.
string | $fieldName |
public digits(int $count):Validation
The field under validation must be numeric and must have an exact length of $count.
int | $count |
public digitsBetween(int $min, int $max):Validation
The field under validation must have a length between the given min and max.
int | $min | |
int | $max |
public email():Validation
The field under validation must be formatted as an e-mail address.
public exists(string $table, array $columns = []):Validation
The field under validation must exist on a given database table.
string | $table | |
array | $columns |
public image():Validation
The file under validation must be an image (jpeg, png, bmp, gif, or svg)
public in(array $values):Validation
The field under validation must be included in the given list of values.
array | $values |
public integer():Validation
The field under validation must be an integer.
public ip():Validation
The field under validation must be an IP address.
public json():Validation
The field under validation must a valid JSON string.
public max(int $value):Validation
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.
int | $value |
public mimeTypes(array $types):Validation
The file under validation must have a MIME type corresponding to one of the listed extensions.
array | $types |
public min(int $value):Validation
The field under validation must have a minimum value. Strings, numerics, and files are evaluated in the same fashion as the size rule.
int | $value |
public notIn($values):Validation
The field under validation must not be included in the given list of values.
$values |
public numeric():Validation
The field under validation must be numeric.
public regex(string $pattern):Validation
The field under validation must match the given regular expression.
string | $pattern |
public required():Validation
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(string $fieldName, $value):Validation
The field under validation must be present if the anotherfield field is equal to any value.
string | $fieldName | |
$value |
public requiredUnless(string $fieldName, string $value):Validation
The field under validation must be present unless the anotherfield field is equal to any value.
string | $fieldName | |
string | $value |
public requiredWith(array $fieldNames):Validation
The field under validation must be present only if any of the other specified fields are present.
array | $fieldNames |
public requiredWithAll(array $fieldNames):Validation
required_with_all
array | $fieldNames |
public requiredWithout(array $fieldNames):Validation
The field under validation must be present only when any of the other specified fields are not present.
array | $fieldNames |
public requiredWithoutAll(array $fieldNames):Validation
The field under validation must be present only when all of the other specified fields are not present.
array | $fieldNames |
public notLike(string $fieldName):Validation
The field under validation must be not like the specified name.
string | $fieldName |
public same(string $fieldName):Validation
The given field must match the field under validation.
string | $fieldName |
public size(int $value):Validation
The field under validation must have a size matching the given value. For string data, value corresponds to the number of characters.
int | $value |
public string():Validation
The field under validation must be a string.
public timezone():Validation
The field under validation must be a valid timezone identifier according to the timezone_identifiers_list PHP function.
public unique(string $table, string $column, string $except = null, string $idColumn = null):Validation
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.
string | $table | |
string | $column | |
string | $except | |
string | $idColumn |
public url():Validation
The field under validation must be a valid URL according to PHP's filter_var function.
public sometimes():Validation
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():Validation
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(bool $allowTimestamps = false):Validation
The field under validation must be a valid w3c formated date time string.
bool | $allowTimestamps | Allow timestamps as a valid format as well. |
public inTimestampRange():Validation
The field under validation must be a w3c formated date time string that is in the MySQL timestamp range (1970 to 2037).
public customRule(string $rule, array $params):Validation
Add custom Role
string | $rule | |
array | $params |
public validPlentyId():Validation
The field under validation must be a valid plentyId.
public validPlentyUrl():Validation
The field must be a valid URL.
public validPlentyDomain():Validation
Custom validation rule for checking the existence of a given domain.
public typeFromDb(string $table, string $column, string $attribute, string $comparisonKey = "id"):Validation
The field under validation must have the type specified in the database.
string | $table | The table with the data type |
string | $column | The column with the data type |
string | $attribute | The attribute in the validator with the key |
string | $comparisonKey | 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():Validation
The field under validation must be a valid data type used by the validation rule 'typeFromDb'.
public validCurrency():Validation
The field under validation must be a valid currency string (e.g. 'EUR').
public validBoardTaskReferenceValue():Validation
The field under validation must be a valid board task reference type (e.g. {@link BoardTaskReferenceType::CONTACT}).
public validPhoneNumber(string $option):Validation
The field under validation must be a valid phone number
string | $option |
public arrayKeysInList($acceptedKeysList):Validation
The field under validation must be an array and must contain only the keys in the provided accepted list.
$acceptedKeysList |
RulesCollection represents a collection of rules connected to an attribute
Plenty\Validation
public add(string $attributeName):Attribute
Add attribute without type
string | $attributeName |
public addConditional(string $attributeName, bool $required):Attribute
Add attribute without type (with or without requirement)
string | $attributeName | |
bool | $required |
public addInt(string $attributeName, bool $required = false):Attribute
Add int attribute
string | $attributeName | |
bool | $required |
public addNumeric(string $attributeName, bool $required = false):Attribute
Add numeric attribute
string | $attributeName | |
bool | $required |
public addDate(string $attributeName, bool $required = false):Attribute
Add date attribute
string | $attributeName | |
bool | $required |
public addBool(string $attributeName, bool $required = false):Attribute
Add bool attribute
string | $attributeName | |
bool | $required |
public addString(string $attributeName, bool $required = false):Attribute
Add string attribute
string | $attributeName | |
bool | $required |
public sometimes(string $attributeName, callable $condition):Attribute
Add a rule for an attribute based on the result of the condition callback.
string | $attributeName | |
callable | $condition |
public arrayKeysInList(string $attributeName, array $acceptedKeysList):Attribute
Add condition to validate if a list contains specific keys
string | $attributeName | |
array | $acceptedKeysList |
Base Validator Class
Plenty\Validation
Type | Name | Description |
---|---|---|
customMessageKey |
public static validateOrFail(array $data):void
Validate the given data against the rules of this validtor
array | $data |
public each(string $attributeName):RulesCollection
Add conditions to each item of a list
string | $attributeName |
public buildCustomMessages():array
Load translated custom message
public getAttributeValue(string $attribute):void
Get the value of the given attribute.
string | $attribute |
public defineAttributes():void
Must be implemented in each subclass. Define the attributes for the validator.
public add(string $attributeName):Attribute
Add attribute without type
string | $attributeName |
public addConditional(string $attributeName, bool $required):Attribute
Add attribute without type (with or without requirement)
string | $attributeName | |
bool | $required |
public addInt(string $attributeName, bool $required = false):Attribute
Add int attribute
string | $attributeName | |
bool | $required |
public addNumeric(string $attributeName, bool $required = false):Attribute
Add numeric attribute
string | $attributeName | |
bool | $required |
public addDate(string $attributeName, bool $required = false):Attribute
Add date attribute
string | $attributeName | |
bool | $required |
public addBool(string $attributeName, bool $required = false):Attribute
Add bool attribute
string | $attributeName | |
bool | $required |
public addString(string $attributeName, bool $required = false):Attribute
Add string attribute
string | $attributeName | |
bool | $required |
public sometimes(string $attributeName, callable $condition):Attribute
Add a rule for an attribute based on the result of the condition callback.
string | $attributeName | |
callable | $condition |
public arrayKeysInList(string $attributeName, array $acceptedKeysList):Attribute
Add condition to validate if a list contains specific keys
string | $attributeName | |
array | $acceptedKeysList |
Plenty\Exceptions
Type | Name | Description |
---|---|---|
messageBag |
public getMessageBag():MessageBag
public setMessageBag(MessageBag $messageBag):Exceptions
MessageBag | $messageBag |
check process
Plenty\Plugin\Build
public addError(string $message):void
string | $message |
Created by ptopczewski, 29.12.15 13:48 Class HTTPException
Plenty\Plugin\Error
public __construct(string $statusCode, string $message, Exception $previous = null):void
HTTPException constructor.
string | $statusCode | |
string | $message | |
Exception | $previous |
Dispatcher
Plenty\Plugin\Events
public isPublicEvent(string $event):bool
string | $event |
public listen($event, $listener, int $priority):void
Register an event listener with the dispatcher.
$event | ||
$listener | ||
int | $priority |
public hasListeners($event):bool
Determine if a given event has listeners.
$event |
public fire($event, array $payload = []):void
Fire an event and call the listeners.
$event | ||
array | $payload |
public dispatch($event, array $payload = []):void
Fire an event and call the listeners.
$event | ||
array | $payload |
public forget($event):void
Remove a set of listeners from the dispatcher.
$event |
public static getPrefix():string
Event
Plenty\Plugin\Events
Class that allows plugin event listeners to be queued.
Plenty\Plugin\Events
http request
Plenty\Plugin\Http
public all():array
Get all of the input and files for the request.
public merge(array $input):void
Merge new input into the current request's input array.
array | $input |
public replace(array $input):void
Replace the input for the current request.
array | $input |
public get(string $key, $default = null, bool $deep = false):void
string | $key | |
$default | ||
bool | $deep |
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.
$key |
public has($key):bool
Determine if the request contains a non-empty value for an input item.
$key |
public input(string $key = null, $default = null):void
Retrieve an input item from the request.
string | $key | |
$default |
public only($keys):array
Get a subset of the items from the input data.
$keys |
public except($keys):array
Get all of the input except for a specified array of items.
$keys |
public query(string $key = null, $default = null):void
Retrieve a query string item from the request.
string | $key | |
$default |
public hasHeader(string $key):bool
Determine if a header is set on the request.
string | $key |
public header(string $key = null, $default = null):void
Retrieve a header from the request.
string | $key | |
$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.
$contentTypes |
public prefers($contentTypes):string
Return the most suitable content type from the given array based on content negotiation.
$contentTypes |
public acceptsJson():bool
Determines whether a request accepts JSON.
public acceptsHtml():bool
Determines whether a request accepts HTML.
public format(string $default = "html"):string
Get the data format expected in the response.
string | $default |
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(string $path):string
Generates a normalized URI for the given path.
string | $path | 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.
Class to create different types of http response.
Plenty\Plugin\Http
public status():int
Get the status code for the response.
public content():string
Get the content of the response.
public make(string $content = "", int $status = 200, array $headers = []):Response
Return a new response from the application.
string | $content | |
int | $status | |
array | $headers |
public view(string $view, array $data = [], int $status = 200, array $headers = []):Response
Return a new view response from the application.
string | $view | |
array | $data | |
int | $status | |
array | $headers |
public json($data = [], int $status = 200, array $headers = [], int $options):Response
Return a new JSON response from the application.
$data | ||
int | $status | |
array | $headers | |
int | $options |
public jsonp(string $callback, $data = [], int $status = 200, array $headers = [], int $options):Response
Return a new JSONP response from the application.
string | $callback | |
$data | ||
int | $status | |
array | $headers | |
int | $options |
public stream(callable $callback, int $status = 200, array $headers = []):Response
Return a new streamed response from the application.
callable | $callback | |
int | $status | |
array | $headers |
public redirectTo(string $path, int $status = 302, array $headers = [], bool $secure = null):Response
Create a new redirect response to the given path.
string | $path | |
int | $status | |
array | $headers | |
bool | $secure |
public redirectToRoute(string $route, array $parameters = [], int $status = 302, array $headers = []):Response
Create a new redirect response to a named route.
string | $route | |
array | $parameters | |
int | $status | |
array | $headers |
public redirectToAction(string $action, array $parameters = [], int $status = 302, array $headers = []):Response
Create a new redirect response to a controller action.
string | $action | |
array | $parameters | |
int | $status | |
array | $headers |
public redirectGuest(string $path, int $status = 302, array $headers = [], bool $secure = null):Response
Create a new redirect response, while putting the current URL in the session.
string | $path | |
int | $status | |
array | $headers | |
bool | $secure |
public redirectToIntended(string $default = "/", int $status = 302, array $headers = [], bool $secure = null):Response
Create a new redirect response to the previously intended location.
string | $default | |
int | $status | |
array | $headers | |
bool | $secure |
public sendHeaders():Http
Send the HTTP headers without sending the whole response.
public forceStatus(int $status = 200):Http
Force sending response with defined status instead of falling back to default handlers in case of 40* status codes.
int | $status |
public isStatusForced():bool
Check if response should be send instead of falling back to default handlers in case of 40* status codes.
Logger factory
Plenty\Plugin\Log
public getLogger(string $pluginNamespace, string $identifier):LoggerContract
string | $pluginNamespace | |
string | $identifier |
Api router service
Plenty\Plugin\Routing
public version(array $version, $second, $third = null):void
array | $version | |
$second | ||
$third |
public get(string $uri, $action):Route
Register a new GET route with the router.
string | $uri | |
$action |
public post(string $uri, $action):Route
Register a new POST route with the router.
string | $uri | |
$action |
public put(string $uri, $action):Route
Register a new PUT route with the router.
string | $uri | |
$action |
public patch(string $uri, $action):Route
Register a new PATCH route with the router.
string | $uri | |
$action |
public delete(string $uri, $action):Route
Register a new DELETE route with the router.
string | $uri | |
$action |
public options(string $uri, $action):Route
Register a new OPTIONS route with the router.
string | $uri | |
$action |
public any(string $uri, $action):Route
Register a new route responding to all verbs.
string | $uri | |
$action |
public resource(string $name, string $controller, array $options = []):void
Route a resource to a controller.
string | $name | |
string | $controller | |
array | $options |
public match(array $methods, string $uri, $action):Route
Register a new route with the given verbs.
array | $methods | |
string | $uri | |
$action |
Route
Plenty\Plugin\Routing
public addMiddleware(array $middleware):Routing
Add middlewares attached to the route.
array | $middleware |
public middleware(array $middleware = []):Routing
Get or set the middlewares attached to the route.
array | $middleware |
public getMiddleware():array
public where(string $name, $expression = null):Routing
string | $name | |
$expression |
Router service
Plenty\Plugin\Routing
public static addRoute($route):void
$route |
public get(string $uri, $action):Route
Register a new GET route with the router.
string | $uri | |
$action |
public post(string $uri, $action):Route
Register a new POST route with the router.
string | $uri | |
$action |
public put(string $uri, $action):Route
Register a new PUT route with the router.
string | $uri | |
$action |
public patch(string $uri, $action):Route
Register a new PATCH route with the router.
string | $uri | |
$action |
public delete(string $uri, $action):Route
Register a new DELETE route with the router.
string | $uri | |
$action |
public options(string $uri, $action):Route
Register a new OPTIONS route with the router.
string | $uri | |
$action |
public any(string $uri, $action):Route
Register a new route responding to all verbs.
string | $uri | |
$action |
public match(array $methods, string $uri, $action):Route
Register a new route with the given verbs.
array | $methods | |
string | $uri | |
$action |
public middleware(string $name, string $class):Routing
Register a short-hand name for a middleware.
string | $name | |
string | $class |
public prepareResponse(Request $request, Response $response):Response
Create a response instance from the given value.
Request | $request | |
Response | $response |
A simple markdown converter.
Plenty\Plugin\Templates
public renderToHtml(string $markdownContent):string
string | $markdownContent |
Twig engine
Plenty\Plugin\Templates
public render(string $name, array $context = []):string
Renders a template.
string | $name | The template name |
array | $context | An array of parameters to pass to the template |
public renderString(string $templateContent, array $context = []):string
Compile and render a twig template from a string.
string | $templateContent | The template to render |
array | $context | An array of parameters to pass to the template |
public addExtension(string $extension):void
Registers an extension.
string | $extension | A Twig_ExtensionInterface instance |
view support
Plenty\Plugin\Templates
public render(string $templatePath, array $data = []):string
string | $templatePath | |
array | $data |
public exists(string $templatePath):bool
string | $templatePath |
translation service
Plenty\Plugin\Translation
public get(string $id, array $parameters = [], string $locale = null):void
Get the translation for a given key.
string | $id | |
array | $parameters | |
string | $locale |
public trans(string $id, array $parameters = [], string $locale = null):void
Get the translation for a given key.
string | $id | |
array | $parameters | |
string | $locale |
describes properties of a Model
Plenty\Plugin\Data\Contracts
public getPropertyInformation(string $modelClassName):array
string | $modelClassName |
Resource
Plenty\Plugin\Data\Contracts
public load(string $resourceName, array $options = []):ResourceInformation
string | $resourceName | |
array | $options | [optional] |
public exists(string $resourceName):bool
string | $resourceName |
property information
Plenty\Plugin\Data\Model
public getType():string
public getName():string
public getDescription():string
resource information
Plenty\Plugin\Data\Model
public getPath():string
public getContentUrl():string
public getData():void
Find and create ExternalAccess-datasets
Plenty\Plugin\ExternalAuth\Contracts
public create(array $data):ExternalAccess
Create a new ExternalAccess record
array | $data | 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(string $type, string $externalId):ExternalAccess
Find
string | $type | The type of the external access |
string | $externalId | The external ID of the contact |
public findForTypeAndContactId(string $type, int $contactId):ExternalAccess
string | $type | The type of the external access |
int | $contactId | The (internal) ID of the contact |
Information on a contact's external access tokens
Plenty\Plugin\ExternalAuth\Models
Type | Name | Description |
---|---|---|
int | contactId | The ID of the contact in question. Must be unique in combination with $accessType. |
string | accessType | The type/provider of external access. Must be unique in combination with $contactId. |
string | externalContactId | The ID of the contact at the external provider. |
string | accessToken | The token for the external access. |
Carbon | lastUpdate | The Date when this record was updated the last time. |
public toArray()
Returns this model as an array.
Log in users with external auth
Plenty\Plugin\ExternalAuth\Services
public logInWithExternalUserId(string $externalId, string $type):void
string | $externalId | |
string | $type |
Plugin AWS Simple Email Service
Plenty\Plugin\Mail\Contracts
public sendEmail(Email $email, AwsSesCredentials $credentials):EmailSenderResult
Composes an email message and immediately queues it for sending via AWS SES
AwsSesCredentials | $credentials |
Plugin Mailer Service
Plenty\Plugin\Mail\Contracts
public sendHtml(string $html, $recipients, string $subject = "", array $cc = [], array $bcc = [], ReplyTo $replyTo = null, array $attachments = []):void
Send an email containing html
string | $html | 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 | |
string | $subject | Optional. The subject of the message |
array | $cc | Optional. Array of strings containing email addresses which the message should be sent to as cc |
array | $bcc | 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 |
array | $attachments | Optional. A list of StorageObject objects ( see Plenty\Modules\Plugin\Storage\Contracts\StorageRepositoryContract ) |
public sendFromTwig(string $twigPath, array $data, $recipients, string $subject = "", array $altConfig = [], array $cc = [], array $bcc = [], ReplyTo $replyTo = null, array $attachments = []):void
Send an email that will get rendered by twig
string | $twigPath | The path to the twig template file that should be used to render the mail. E.g.: 'PluginNamespace::mail.my_mail' |
array | $data | 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 | |
string | $subject | Optional. The subject of the message |
array | $altConfig | 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. |
array | $cc | Optional. Array of strings containing email addresses which the message should be sent to as cc |
array | $bcc | 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 |
array | $attachments | Optional. A list of StorageObject objects ( see Plenty\Modules\Plugin\Storage\Contracts\StorageRepositoryContract ) |
public sendFromMime(string $mimeMessage, $recipients, array $altConfig = [], array $cc = [], array $bcc = [], ReplyTo $replyTo = null, array $attachments = []):void
Send given message as email
string | $mimeMessage | Complete email mime source header included |
$recipients | Either a string containing a single email address or an array of strings containing multiple email addresses | |
array | $altConfig | 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. |
array | $cc | Optional. Array of strings containing email addresses which the message should be sent to as cc |
array | $bcc | 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 |
array | $attachments | Optional. A list of StorageObject objects ( see Plenty\Modules\Plugin\Storage\Contracts\StorageRepositoryContract ) |
the credential model for AWS SES client.
Plenty\Plugin\Mail\Models
Type | Name | Description |
---|---|---|
string | region | AWS region e.g. eu-west-1 |
string | accessKeyId | User access key |
string | secretAccessKey | User secret access key |
public toArray()
Returns this model as an array.
the email model.
Plenty\Plugin\Mail\Models
Type | Name | Description |
---|---|---|
array | bccAddresses | BCC email address |
array | ccAddresses | CC email address |
array | toAddresses | To email address |
string | senderAddress | Sender email address |
array | replyToAddresses | Reply to email address |
string | subject | Email subject |
string | htmlBody | HTML email body |
string | plainTextBody | Plain text email body |
string | rawMessage | MIME message, if set subject, html and plainText are ignored |
public toArray()
Returns this model as an array.
the email sender result model.
Plenty\Plugin\Mail\Models
Type | Name | Description |
---|---|---|
int | messageId | |
string | message | |
int | errorCode |
public toArray()
Returns this model as an array.
ReplyTo
Plenty\Plugin\Mail\Models
Type | Name | Description |
---|---|---|
string | mailAddress | The mail address to reply. |
string | name | The name to reply. |
public toArray()
Returns this model as an array.
TwigFilter
Plenty\Plugin\Templates\Extensions
TwigFunction
Plenty\Plugin\Templates\Extensions
Twig extension
Plenty\Plugin\Templates\Extensions
public getName():string
public getGlobals():void
Twig SimpleFilter
Plenty\Plugin\Templates\Extensions
Twig SimpleFunction
Plenty\Plugin\Templates\Extensions
Twig Factory
Plenty\Plugin\Templates\Factories
public register():void
public createSimpleFunction(string $name, $callable, array $params = []):Twig_SimpleFunction
string | $name | |
$callable | ||
array | $params | An array of parameters |
public createSimpleFilter(string $name, $callable, array $params = []):Twig_SimpleFilter
string | $name | |
$callable | ||
array | $params | An array of parameters |
DeleteResponse Interface
Plenty\Repositories\Contracts
public getAffectedRows():int
public setAffectedRows(int $value):void
int | $value |
public increment():int
public decrement():int
Contract for PaginationResponse
Plenty\Repositories\Contracts
public getTotal():void
public setTotal($total):void
$total |
public getPage():void
public setPage($page):void
$page |
public getEntriesPerPage():void
public setEntriesPerPage($epp):void
$epp |
public getResult():void
public setResult($entries):void
$entries |
public toJson(int $options):string
Convert the object to its JSON representation.
int | $options |
public toArray():array
Get the instance as an array.
comparison class
Plenty\Repositories\Criteria
public getOperator():string
public getTerm():void
public isOperator(string $comparison):bool
string | $comparison |
public castTerm(string $castTo):void
string | $castTo |
The contract for defining criteria.
Plenty\Repositories\Criteria
public comparisons():array
public apply($builder, CriteriableContract $repository):void
$builder | ||
CriteriableContract | $repository |
public allowedComparators():array
Delete Response
Plenty\Repositories\Models
Type | Name | Description |
---|---|---|
int | affectedRows |
public toArray()
Returns this model as an array.
Filtered paginated result
Plenty\Repositories\Models
public getFilters():array
public setFilters(array $filters):void
array | $filters |
public toArray():array
Get the instance as an array.
public paginate():Models
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
$result |
public toJson(int $options):string
Convert the object to its JSON representation.
int | $options |
public jsonSerialize():void
Specify data which should be serialized to JSON
paginated result
Plenty\Repositories\Models
public paginate():Models
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
$result |
public toArray():array
Get the instance as an array.
public toJson(int $options):string
Convert the object to its JSON representation.
int | $options |
public jsonSerialize():void
Specify data which should be serialized to JSON
Unspecified length pagination response
Plenty\Repositories\Models
public getPage():int
public getItemsPerPage():int
public getFirstOnPage():void
public getLastOnPage():void
public isLastPage():bool
public jsonSerialize():array
Array pagination
Plenty\Repositories\Services
public setCurrentItemsPerPage(int $currentItemsPerPage):Services
int | $currentItemsPerPage |
public setCurrentPage(int $currentPage):Services
int | $currentPage |
public getCurrentItemsPerPage():int
public getCurrentPage():int
Array pagination
Plenty\Repositories\Services
public buildResult(int $page, int $offset):Collection
int | $page | |
int | $offset |
public getTotalCount():int
Register repository criteria
Plenty\Repositories\Criteria\Containers
public add(string $repository, string $criteria, string $key):Containers
Use this method to add criteria to a existing repository.
string | $repository | The repository that should use the criteria |
string | $criteria | The criteria class name that should be used. |
string | $key | The key that should match the given criteria. |
Interface which provides the possibility to use Criteria filters.
Plenty\Repositories\Criteria\Contracts
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.
Interface which provides the possibility to extends repositories with new Criteria filters.
Plenty\Repositories\Criteria\Contracts
Common interface for attribute classes
Plenty\Validation\Contracts
public getAttributeName():string
Returns the attribute's name
public setAttributeName(string $attributeName):Contracts
Sets the attribute's name
string | $attributeName |
public accepted():Contracts
The field under validation must be yes, on, 1, or true. This is useful for validating "Terms of Service" acceptance.
public customRule(string $rule, array $params):Contracts
Add custom Role
string | $rule | |
array | $params |
public activeUrl():Contracts
The field under validation must be a valid URL according to the checkdnsrr PHP function.
public dateAfter(string $fieldNameOrTimeStr):Contracts
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
string | $fieldNameOrTimeStr |
public alphabetic():Contracts
The field under validation must be entirely alphabetic characters.
public alphaDash():Contracts
The field under validation may have alpha-numeric characters, as well as dashes and underscores.
public alphaNum():Contracts
The field under validation must be entirely alpha-numeric characters.
public isArray():Contracts
The field under validation must be a PHP array.
public dateBefore(string $fieldNameOrTimeStr):Contracts
The field under validation must be a value preceding the given date. The dates will be passed into the PHP strtotime function.
string | $fieldNameOrTimeStr |
public between(int $min, int $max):Contracts
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.
int | $min | |
int | $max |
public boolean():Contracts
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():Contracts
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():Contracts
Validate that an attribute exists even if not filled.
public date():Contracts
The field under validation must be a valid date according to the strtotime PHP function.
public dateFormat(string $format):Contracts
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.
string | $format |
public dateW3C(bool $allowTimestamps = false):Contracts
The field under validation must be a valid w3c formated date time string.
bool | $allowTimestamps | Allow timestamps as a valid format as well. |
public inTimestampRange():Contracts
The field under validation must be a w3c formated date time string that is in the MySQL timestamp range (1970 to 2037).
public validPlentyId():Contracts
The field under validation must be a valid plentyId.
public validPlentyUrl():Contracts
The field under validation must be a valid plentyId.
public validPlentyDomain():Contracts
The field under validation must be a unique domain.
public typeFromDb(string $table, string $column, string $attribute, string $comparisonKey = "id"):Contracts
The field under validation must have the type specified in the database.
string | $table | The table with the data type |
string | $column | The column with the data type |
string | $attribute | The attribute in the validator with the key |
string | $comparisonKey | The column to in $table to compare $attribute to. Default is 'id'. |
public hexColor():Attribute
The field under validation must be a valid HEX color (like "#a3d" or "#a0787c").
public rgbColor():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():Attribute
The field under validation must be a valid predefined CSS color (like "aquamarine" or "skyblue").
public color():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():Attribute
The field under validation must be a valid UUID version 5.
public validDbType():Contracts
The field under validation must be a valid data type used by the validation rule 'typeFromDb'.
public validCurrency():Contracts
The field under validation must be a valid currency string (e.g. 'EUR').
public different(string $fieldName):Contracts
The field under validation must have a different value than field.
string | $fieldName |
public digits(int $count):Contracts
The field under validation must be numeric and must have an exact length of $count.
int | $count |
public digitsBetween(int $min, int $max):Contracts
The field under validation must have a length between the given min and max.
int | $min | |
int | $max |
public email():Contracts
The field under validation must be formatted as an e-mail address.
public exists(string $table, array $columns = []):Contracts
The field under validation must exist on a given database table.
string | $table | |
array | $columns |
public image():Contracts
The file under validation must be an image (jpeg, png, bmp, gif, or svg)
public in(array $values):Contracts
The field under validation must be included in the given list of values.
array | $values |
public integer():Contracts
The field under validation must be an integer.
public ip():Contracts
The field under validation must be an IP address.
public json():Contracts
The field under validation must a valid JSON string.
public max(int $value):Contracts
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.
int | $value |
public mimeTypes(array $types):Contracts
The file under validation must have a MIME type corresponding to one of the listed extensions.
array | $types |
public min(int $value):Contracts
The field under validation must have a minimum value. Strings, numerics, and files are evaluated in the same fashion as the size rule.
int | $value |
public notIn($values):Contracts
The field under validation must not be included in the given list of values.
$values |
public numeric():Contracts
The field under validation must be numeric.
public regex(string $pattern):Contracts
The field under validation must match the given regular expression.
string | $pattern |
public required():Contracts
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(string $fieldName, $value):Contracts
The field under validation must be present if the anotherfield field is equal to any value.
string | $fieldName | |
$value |
public requiredUnless(string $fieldName, string $value):Contracts
The field under validation must be present unless the anotherfield field is equal to any value.
string | $fieldName | |
string | $value |
public requiredWith(array $fieldNames):Contracts
The field under validation must be present only if any of the other specified fields are present.
array | $fieldNames |
public requiredWithAll(array $fieldNames):Contracts
required_with_all
array | $fieldNames |
public requiredWithout(array $fieldNames):Contracts
The field under validation must be present only when any of the other specified fields are not present.
array | $fieldNames |
public requiredWithoutAll(array $fieldNames):Contracts
The field under validation must be present only when all of the other specified fields are not present.
array | $fieldNames |
public notLike(string $fieldName):Contracts
The field under validation must be not like the specified name.
string | $fieldName |
public same(string $fieldName):Contracts
The given field must match the field under validation.
string | $fieldName |
public size(int $value):Contracts
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.
int | $value |
public string():Contracts
The field under validation must be a string.
public timezone():Contracts
The field under validation must be a valid timezone identifier according to the timezone_identifiers_list PHP function.
public unique(string $table, string $column, string $except = null, string $idColumn = null):Contracts
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.
string | $table | |
string | $column | |
string | $except | |
string | $idColumn |
public url():Contracts
The field under validation must be a valid URL according to PHP's filter_var function.
public sometimes():Contracts
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():Contracts
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():Contracts
The field under validation must be a valid board task reference type (e.g. {@link BoardTaskReferenceType::CONTACT}).
public arrayKeysInList($acceptedKeysList):Contracts
The field under validation must be an array and must contain only the keys in the provided accepted list.
$acceptedKeysList |
Instantiates Attribute Classes
Plenty\Validation\Service
public create(string $which):Attribute
Creates a new attribute
string | $which |
Instantiates Validator Classes
Plenty\Validation\Service
public create(string $validatorClass):Validator
Creates a new validator
string | $validatorClass | The fully qualified classname of the validator to create (including namespace) |
Illuminate\Support
public keys():array
Get the keys present in the message bag.
public add(string $key, string $message):Support
Add a message to the message bag.
string | $key | |
string | $message |
public merge($messages):Support
Merge a new array of messages into the message bag.
$messages |
public has($key):bool
Determine if messages exist for all of the given keys.
$key |
public hasAny($keys = []):bool
Determine if messages exist for any of the given keys.
$keys |
public first(string $key = null, string $format = null):string
Get the first message from the message bag for a given key.
string | $key | |
string | $format |
public get(string $key, string $format = null):array
Get all of the messages from the message bag for a given key.
string | $key | |
string | $format |
public all(string $format = null):array
Get all of the messages for every key in the message bag.
string | $format |
public unique(string $format = null):array
Get all of the unique messages for every key in the message bag.
string | $format |
public messages():array
Get the raw messages in the message bag.
public getMessages():array
Get the raw messages in the message bag.
public getMessageBag():MessageBag
Get the messages for the instance.
public getFormat():string
Get the default message format.
public setFormat(string $format = ":message"):MessageBag
Set the default message format.
string | $format |
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(int $options):string
Convert the object to its JSON representation.
int | $options |
Illuminate\Support
public static times(int $number, callable $callback = null):Support
Create a new collection by invoking the callback a given amount of times.
int | $number | |
callable | $callback |
public all():array
Get all of the items in the collection.
public avg($callback = null):void
Get the average value of a given key.
$callback |
public mode($key = null):array
Get the mode of a given key.
$key |
public collapse():Support
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.
$key | ||
$operator | ||
$value |
public crossJoin($lists):Support
Cross join with the given lists, returning all possible permutations.
$lists |
public diff($items):Support
Get the items in the collection that are not present in the given items.
$items |
public diffAssoc($items):Support
Get the items in the collection whose keys and values are not present in the given items.
$items |
public diffKeys($items):Support
Get the items in the collection whose keys are not present in the given items.
$items |
public except($keys):Support
Get all items except for those with the specified keys.
$keys |
public filter(callable $callback = null):Support
Run a filter over each of the items.
callable | $callback |
public first(callable $callback = null, $default = null):void
Get the first item from the collection passing the given truth test.
callable | $callback | |
$default |
public flip():Support
Flip the items in the collection.
public forget($keys):Support
Remove an item from the collection by key.
$keys |
public get($key, $default = null):void
Get an item from the collection by key.
$key | ||
$default |
public groupBy($groupBy, bool $preserveKeys = false):Support
Group an associative array by a field or using a callback.
$groupBy | ||
bool | $preserveKeys |
public keyBy($keyBy):Support
Key an associative array by a field or using a callback.
$keyBy |
public has($key):bool
Determine if an item exists in the collection by key.
$key |
public implode(string $value, string $glue = null):string
Concatenate values of a given key as a string.
string | $value | |
string | $glue |
public intersect($items):Support
Intersect the collection with the given items.
$items |
public intersectByKeys($items):Support
Intersect the collection with the given items by key.
$items |
public isEmpty():bool
Determine if the collection is empty or not.
public keys():Support
Get the keys of the collection items.
public last(callable $callback = null, $default = null):void
Get the last item from the collection.
callable | $callback | |
$default |
public pluck($value, string $key = null):Support
Get the values of a given key.
$value | ||
string | $key |
public map(callable $callback):Support
Run a map over each of the items.
callable | $callback |
public mapToDictionary(callable $callback):Support
Run a dictionary map over the items.
callable | $callback |
public mapWithKeys(callable $callback):Support
Run an associative map over each of the items.
callable | $callback |
public merge($items):Support
Merge the collection with the given items.
$items |
public combine($values):Support
Create a collection by using this collection for keys and another for its values.
$values |
public union($items):Support
Union the collection with the given items.
$items |
public nth(int $step, int $offset):Support
Create a new collection consisting of every n-th element.
int | $step | |
int | $offset |
public only($keys):Support
Get the items with the specified keys.
$keys |
public pop():void
Get and remove the last item from the collection.
public prepend($value, $key = null):Support
Push an item onto the beginning of the collection.
$value | ||
$key |
public push($value):Support
Push an item onto the end of the collection.
$value |
public pull($key, $default = null):void
Get and remove an item from the collection.
$key | ||
$default |
public put($key, $value):Support
Put an item in the collection by key.
$key | ||
$value |
public random(int $number = null):void
Get one or a specified number of items randomly from the collection.
int | $number |
public reduce(callable $callback, $initial = null):void
Reduce the collection to a single value.
callable | $callback | |
$initial |
public reverse():Support
Reverse items order.
public search($value, bool $strict = false):void
Search the collection for a given value and return the corresponding key if successful.
$value | ||
bool | $strict |
public shift():void
Get and remove the first item from the collection.
public shuffle(int $seed = null):Support
Shuffle the items in the collection.
int | $seed |
public slice(int $offset, int $length = null):Support
Slice the underlying collection array.
int | $offset | |
int | $length |
public split(int $numberOfGroups):Support
Split a collection into a certain number of groups.
int | $numberOfGroups |
public chunk(int $size):Support
Chunk the collection into chunks of the given size.
int | $size |
public sort(callable $callback = null):Support
Sort through each item with a callback.
callable | $callback |
public splice(int $offset, int $length = null, $replacement = []):Support
Splice a portion of the underlying collection array.
int | $offset | |
int | $length | |
$replacement |
public take(int $limit):Support
Take the first or last {$limit} items.
int | $limit |
public transform(callable $callback):Support
Transform each item in the collection using a callback.
callable | $callback |
public values():Support
Reset the keys on the underlying array.
public zip($items):Support
Zip the collection together with one or more arrays.
$items |
public pad(int $size, $value):Support
Pad collection to the specified length with a value.
int | $size | |
$value |
public count():int
Count the number of items in the collection.
public offsetExists($key):bool
Determine if an item exists at an offset.
$key |
public offsetGet($key):void
Get an item at a given offset.
$key |
public offsetSet($key, $value):void
Set the item at a given offset.
$key | ||
$value |
public offsetUnset(string $key):void
Unset the item at a given offset.
string | $key |
public static make($items = []):Support
Create a new collection instance if the value isn't one already.
$items |
public static wrap($value):Support
Wrap the given value in a collection if applicable.
$value |
public static unwrap($value):array
Get the underlying items from the given collection if applicable.
$value |
public average($callback = null):void
Alias for the "avg" method.
$callback |
public containsStrict($key, $value = null):bool
Determine if an item exists, using strict comparison.
$key | ||
$value |
public each(callable $callback):Support
Execute a callback over each item.
callable | $callback |
public eachSpread(callable $callback):Support
Execute a callback over each nested chunk of items.
callable | $callback |
public every($key, $operator = null, $value = null):bool
Determine if all items pass the given truth test.
$key | ||
$operator | ||
$value |
public firstWhere(string $key, $operator = null, $value = null):void
Get the first item by the given key value pair.
string | $key | |
$operator | ||
$value |
public isNotEmpty():bool
Determine if the collection is not empty.
public mapSpread(callable $callback):Support
Run a map over each nested chunk of items.
callable | $callback |
public mapToGroups(callable $callback):Support
Run a grouping map over the items.
callable | $callback |
public flatMap(callable $callback):Support
Map a collection and flatten the result by a single level.
callable | $callback |
public mapInto(string $class):Support
Map the values into a new class.
string | $class |
public min($callback = null):void
Get the min value of a given key.
$callback |
public max($callback = null):void
Get the max value of a given key.
$callback |
public forPage(int $page, int $perPage):Support
"Paginate" the collection by slicing it into a smaller collection.
int | $page | |
int | $perPage |
public partition($key, $operator = null, $value = null):Support
Partition the collection into two arrays using the given callback or key.
$key | ||
$operator | ||
$value |
public sum($callback = null):void
Get the sum of the given values.
$callback |
public when($value, callable $callback, callable $default = null):void
Apply the callback if the value is truthy.
$value | ||
callable | $callback | |
callable | $default |
public unless(bool $value, callable $callback, callable $default = null):void
Apply the callback if the value is falsy.
bool | $value | |
callable | $callback | |
callable | $default |
public where(string $key, $operator = null, $value = null):Support
Filter items by the given key value pair.
string | $key | |
$operator | ||
$value |
public whereStrict(string $key, $value):Support
Filter items by the given key value pair using strict comparison.
string | $key | |
$value |
public whereIn(string $key, $values, bool $strict = false):Support
Filter items by the given key value pair.
string | $key | |
$values | ||
bool | $strict |
public whereInStrict(string $key, $values):Support
Filter items by the given key value pair using strict comparison.
string | $key | |
$values |
public whereNotIn(string $key, $values, bool $strict = false):Support
Filter items by the given key value pair.
string | $key | |
$values | ||
bool | $strict |
public whereNotInStrict(string $key, $values):Support
Filter items by the given key value pair using strict comparison.
string | $key | |
$values |
public pipe(callable $callback):void
Pass the collection to the given callback and return the result.
callable | $callback |
public tap(callable $callback):Support
Pass the collection to the given callback and then return it.
callable | $callback |
public reject($callback = true):Support
Create a collection of all elements that do not pass a given truth test.
$callback |
public unique($key = null, bool $strict = false):Support
Return only unique items from the collection array.
$key | ||
bool | $strict |
public uniqueStrict($key = null):Support
Return only unique items from the collection array using strict comparison.
$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(int $options):string
Get the collection of items as JSON.
int | $options |
public static proxy(string $method):void
Add a method to the list of proxied methods.
string | $method |
public static macro(string $name, $macro):void
Register a custom macro.
string | $name | |
$macro |
public static hasMacro(string $name):bool
Checks if macro is registered.
string | $name |
Illuminate\Support
Carbon
public copy():Carbon
Get a copy of the instance.
public nowWithSameTz():Carbon
Returns a present instance in the same timezone.
public setDateTime(int $year, int $month, int $day, int $hour, int $minute, int $second, int $microseconds):Carbon
Set the date and time all together.
int | $year | |
int | $month | |
int | $day | |
int | $hour | |
int | $minute | |
int | $second | |
int | $microseconds |
public setTimeFromTimeString(string $time):Carbon
Set the time by time string.
string | $time |
public timezone($value):Carbon
$value |
public tz($value = null):void
Set the timezone or returns the timezone name if no arguments passed.
$value |
public setDateFrom($date = null):Carbon
Set the year, month, and date for this instance to that of the passed instance.
$date | now if null |
public setTimeFrom($date = null):Carbon
Set the hour, minute, second and microseconds for this instance to that of the passed instance.
$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
$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
$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(array $days):void
array | $days |
public static hasRelativeKeywords(string $time):bool
Determine if a time string will produce a relative date.
string | $time |
public static setUtf8(bool $utf8):void
bool | $utf8 |
public formatLocalized(string $format):string
Format the instance with the current locale. You can set the current locale using setlocale() http://php.net/setlocale.
string | $format |
public startOfDay():Carbon
Resets the time to 00:00:00 start of day
public endOfDay():Carbon
Resets the time to 23:59:59.999999 end of day
public startOfMonth():Carbon
Resets the date to the first day of the month and the time to 00:00:00
public endOfMonth():Carbon
Resets the date to end of the month and time to 23:59:59.999999
public startOfQuarter():Carbon
Resets the date to the first day of the quarter and the time to 00:00:00
public endOfQuarter():Carbon
Resets the date to end of the quarter and time to 23:59:59.999999
public startOfYear():Carbon
Resets the date to the first day of the year and the time to 00:00:00
public endOfYear():Carbon
Resets the date to end of the year and time to 23:59:59.999999
public startOfDecade():Carbon
Resets the date to the first day of the decade and the time to 00:00:00
public endOfDecade():Carbon
Resets the date to end of the decade and time to 23:59:59.999999
public startOfCentury():Carbon
Resets the date to the first day of the century and the time to 00:00:00
public endOfCentury():Carbon
Resets the date to end of the century and time to 23:59:59.999999
public startOfWeek(int $weekStartsAt = null):Carbon
Resets the date to the first day of week (defined in $weekStartsAt) and the time to 00:00:00
int | $weekStartsAt | optional start allow you to specify the day of week to use to start the week |
public endOfWeek(int $weekEndsAt = null):Carbon
Resets the date to end of week (defined in $weekEndsAt) and time to 23:59:59.999999
int | $weekEndsAt | optional start allow you to specify the day of week to use to end the week |
public startOfHour():Carbon
Modify to start of current hour, minutes and seconds become 0
public endOfHour():Carbon
Modify to end of current hour, minutes and seconds become 59
public startOfMinute():Carbon
Modify to start of current minute, seconds become 0
public endOfMinute():Carbon
Modify to end of current minute, seconds become 59
public eq($date):bool
Determines if the instance is equal to another
$date |
public equalTo($date):bool
Determines if the instance is equal to another
$date |
public ne($date):bool
Determines if the instance is not equal to another
$date |
public notEqualTo($date):bool
Determines if the instance is not equal to another
$date |
public gt($date):bool
Determines if the instance is greater (after) than another
$date |
public greaterThan($date):bool
Determines if the instance is greater (after) than another
$date |
public gte($date):bool
Determines if the instance is greater (after) than or equal to another
$date |
public greaterThanOrEqualTo($date):bool
Determines if the instance is greater (after) than or equal to another
$date |
public lt($date):bool
Determines if the instance is less (before) than another
$date |
public lessThan($date):bool
Determines if the instance is less (before) than another
$date |
public lte($date):bool
Determines if the instance is less (before) or equal to another
$date |
public lessThanOrEqualTo($date):bool
Determines if the instance is less (before) or equal to another
$date |
public between($date1, $date2, bool $equal = true):bool
Determines if the instance is between two others.
$date1 | ||
$date2 | ||
bool | $equal | 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
public isSameAs(string $format, $date = null):bool
Compares the formatted values of the two dates.
string | $format | date formats to compare. |
$date | instance to compare with or null to use current day. |
public isSameQuarter($date = null, bool $ofSameYear = true):bool
Checks if the passed in date is in the same quarter as the instance quarter (and year if needed).
$date | The instance to compare with or null to use current day. | |
bool | $ofSameYear | Check if it is the same month in the same year. |
public isSameMonth($date = null, bool $ofSameYear = true):bool
Checks if the passed in date is in the same month as the instance´s month.
$date | The instance to compare with or null to use the current date. | |
bool | $ofSameYear | Check if it is the same month in the same year. |
public isDayOfWeek(int $dayOfWeek):bool
Checks if this day is a specific day of the week.
int | $dayOfWeek |
public isBirthday($date = null):bool
Check if its the birthday. Compares the date/month values of the two dates.
$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(string $date, string $format):bool
Checks if the (date)time string is in a given format.
string | $date | |
string | $format |
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
$format |
public toDateString():string
Format the instance as date
public toFormattedDateString():string
Format the instance as a readable date
public toTimeString(string $unitPrecision = "second"):string
Format the instance as time
string | $unitPrecision |
public toDateTimeString(string $unitPrecision = "second"):string
Format the instance as date and time
string | $unitPrecision |
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(string $unitPrecision = "second"):string
Convert the instance to UTC and return as Zulu ISO8601
string | $unitPrecision |
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(bool $extended = false):string
Format the instance as RFC3339
bool | $extended |
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 instance(DateTimeInterface $date):Carbon
Create a Carbon instance from a DateTime one.
DateTimeInterface | $date |
public static parse($time = null, $tz = null):Carbon
Create a carbon instance from a string.
$time | ||
$tz |
public static now($tz = null):Carbon
Get a Carbon instance for the current date and time.
$tz |
public static today($tz = null):Carbon
Create a Carbon instance for today.
$tz |
public static tomorrow($tz = null):Carbon
Create a Carbon instance for tomorrow.
$tz |
public static yesterday($tz = null):Carbon
Create a Carbon instance for yesterday.
$tz |
public static maxValue():Carbon
Create a Carbon instance for the greatest supported date.
public static minValue():Carbon
Create a Carbon instance for the lowest supported date.
public static create(int $year, int $month = 1, int $day = 1, int $hour, int $minute, int $second, $tz = null):void
Create a new Carbon instance from a specific date and time.
int | $year | |
int | $month | |
int | $day | |
int | $hour | |
int | $minute | |
int | $second | |
$tz |
public static createSafe(int $year = null, int $month = null, int $day = null, int $hour = null, int $minute = null, int $second = null, $tz = null):void
Create a new safe Carbon instance from a specific date and time.
int | $year | |
int | $month | |
int | $day | |
int | $hour | |
int | $minute | |
int | $second | |
$tz |
public static createFromDate(int $year = null, int $month = null, int $day = null, $tz = null):Carbon
Create a Carbon instance from just a date. The time portion is set to now.
int | $year | |
int | $month | |
int | $day | |
$tz |
public static createMidnightDate(int $year = null, int $month = null, int $day = null, $tz = null):Carbon
Create a Carbon instance from just a date. The time portion is set to midnight.
int | $year | |
int | $month | |
int | $day | |
$tz |
public static createFromTime(int $hour, int $minute, int $second, $tz = null):Carbon
Create a Carbon instance from just a time. The date portion is set to today.
int | $hour | |
int | $minute | |
int | $second | |
$tz |
public static createFromTimeString(string $time, $tz = null):Carbon
Create a Carbon instance from a time string. The date portion is set to today.
string | $time | |
$tz |
public diffInYears($date = null, bool $absolute = true):int
Get the difference in years
$date | ||
bool | $absolute | Get the absolute of the difference |
public diffInMonths($date = null, bool $absolute = true):int
Get the difference in months rounded down.
$date | ||
bool | $absolute | Get the absolute of the difference |
public diffInWeeks($date = null, bool $absolute = true):int
Get the difference in weeks rounded down.
$date | ||
bool | $absolute | Get the absolute of the difference |
public diffInDays($date = null, bool $absolute = true):int
Get the difference in days rounded down.
$date | ||
bool | $absolute | Get the absolute of the difference |
public diffInWeekdays($date = null, bool $absolute = true):int
Get the difference in weekdays rounded down.
$date | ||
bool | $absolute | Get the absolute of the difference |
public diffInWeekendDays($date = null, bool $absolute = true):int
Get the difference in weekend days using a filter rounded down.
$date | ||
bool | $absolute | Get the absolute of the difference |
public diffInHours($date = null, bool $absolute = true):int
Get the difference in hours rounded down.
$date | ||
bool | $absolute | Get the absolute of the difference |
public diffInRealHours($date = null, bool $absolute = true):int
Get the difference in hours rounded down using timestamps.
$date | ||
bool | $absolute | Get the absolute of the difference |
public diffInMinutes($date = null, bool $absolute = true):int
Get the difference in minutes rounded down.
$date | ||
bool | $absolute | Get the absolute of the difference |
public diffInRealMinutes($date = null, bool $absolute = true):int
Get the difference in minutes rounded down using timestamps.
$date | ||
bool | $absolute | Get the absolute of the difference |
public diffInSeconds($date = null, bool $absolute = true):int
Get the difference in seconds rounded down.
$date | ||
bool | $absolute | Get the absolute of the difference |
public diffInRealSeconds($date = null, bool $absolute = true):int
Get the difference in seconds using timestamps.
$date | ||
bool | $absolute | 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, bool $short = false, int $parts = 1, int $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).
$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) - '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) 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 | |
bool | $short | displays short format of time units |
int | $parts | maximum number of parts to display (default value: 1: single unit) |
int | $options | human diff options |
public static macro(string $name, $macro):void
Register a custom macro.
string | $name | |
$macro |
public static hasMacro(string $name):bool
Checks if macro is registered globally.
string | $name |
public static getMidDayAt():int
get midday/noon hour
public static setMidDayAt(int $hour):void
int | $hour | midday hour |
public midDay():Carbon
Modify to midday, default to self::$midDayAt
public next($modifier = null):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.
$modifier |
public nextWeekday():Carbon
Go forward to the next weekday.
public previousWeekday():Carbon
Go backward to the previous weekday.
public nextWeekendDay():Carbon
Go forward to the next weekend day.
public previousWeekendDay():Carbon
Go backward to the previous weekend day.
public previous($modifier = null):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.
$modifier |
public firstOfMonth(int $dayOfWeek = null):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.
int | $dayOfWeek |
public lastOfMonth(int $dayOfWeek = null):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.
int | $dayOfWeek |
public nthOfMonth(int $nth, int $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.
int | $nth | |
int | $dayOfWeek |
public firstOfQuarter(int $dayOfWeek = null):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.
int | $dayOfWeek | day of the week default null |
public lastOfQuarter(int $dayOfWeek = null):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.
int | $dayOfWeek | day of the week default null |
public nthOfQuarter(int $nth, int $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.
int | $nth | |
int | $dayOfWeek |
public firstOfYear(int $dayOfWeek = null):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.
int | $dayOfWeek | day of the week default null |
public lastOfYear(int $dayOfWeek = null):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.
int | $dayOfWeek | day of the week default null |
public nthOfYear(int $nth, int $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.
int | $nth | |
int | $dayOfWeek |
public average($date = null):Carbon
Modify the current instance to the average of a given instance (default now) and the current instance (second-precision).
$date |
public closest($date1, $date2):Carbon
Get the closest date from the instance (second-precision).
$date1 | ||
$date2 |
public farthest($date1, $date2):Carbon
Get the farthest date from the instance (second-precision).
$date1 | ||
$date2 |
public min($date = null):Carbon
Get the minimum instance between a given instance (default now) and the current instance.
$date |
public minimum($date = null):Carbon
Get the minimum instance between a given instance (default now) and the current instance.
$date |
public max($date = null):Carbon
Get the maximum instance between a given instance (default now) and the current instance.
$date |
public maximum($date = null):Carbon
Get the maximum instance between a given instance (default now) and the current instance.
$date |
public static useMonthsOverflow(bool $monthsOverflow = true):void
bool | $monthsOverflow |
public static resetMonthsOverflow():void
public static shouldOverflowMonths():bool
Get the month overflow global behavior (can be overridden in specific instances).
public static useYearsOverflow(bool $yearsOverflow = true):void
bool | $yearsOverflow |
public static resetYearsOverflow():void
public static shouldOverflowYears():bool
Get the month overflow global behavior (can be overridden in specific instances).
public static setHumanDiffOptions(int $humanDiffOptions):void
int | $humanDiffOptions |
public static enableHumanDiffOption(int $humanDiffOption):void
int | $humanDiffOption |
public static disableHumanDiffOption(int $humanDiffOption):void
int | $humanDiffOption |
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(string $value):Carbon
Create an instance from a serialized string.
string | $value |
public jsonSerialize():void
Prepare the object for JSON serialization.
public static serializeUsing(callable $callback):void
callable | $callback |
public static createFromTimestamp($timestamp, $tz = null):Carbon
Create a Carbon instance from a timestamp and set the timezone (use default one if not specified).
$timestamp | ||
$tz |
public static createFromTimestampUTC($timestamp):Carbon
Create a Carbon instance from an timestamp keeping the timezone to UTC.
$timestamp |
public static createFromTimestampMs($timestamp, $tz = null):Carbon
Create a Carbon instance from a timestamp in milliseconds.
$timestamp | ||
$tz |
public timestamp($unixTimestamp):Carbon
Set the instance's timestamp.
$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).
$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).
$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(int $value):Carbon
Set current instance year to the given value.
int | $value |
public month(int $value):Carbon
Set current instance month to the given value.
int | $value |
public day(int $value):Carbon
Set current instance day to the given value.
int | $value |
public hour(int $value):Carbon
Set current instance hour to the given value.
int | $value |
public minute(int $value):Carbon
Set current instance minute to the given value.
int | $value |
public second(int $value):Carbon
Set current instance second to the given value.
int | $value |
public addYears(int $value = 1):Carbon
Add years (the $value count passed in) to the instance (using date interval).
int | $value = 1 |
public addYear():Carbon
Add one year to the instance (using date interval).
public subYears(int $value = 1):Carbon
Sub years (the $value count passed in) to the instance (using date interval).
int | $value = 1 |
public subYear():Carbon
Sub one year to the instance (using date interval).
public addYearsWithOverflow(int $value = 1):Carbon
Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
int | $value = 1 |
public addYearWithOverflow():Carbon
Add one year to the instance (using date interval) with overflow explicitly allowed.
public subYearsWithOverflow(int $value = 1):Carbon
Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
int | $value = 1 |
public subYearWithOverflow():Carbon
Sub one year to the instance (using date interval) with overflow explicitly allowed.
public addYearsNoOverflow(int $value = 1):Carbon
Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
int | $value = 1 |
public addYearNoOverflow():Carbon
Add one year to the instance (using date interval) with overflow explicitly forbidden.
public subYearsNoOverflow(int $value = 1):Carbon
Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
int | $value = 1 |
public subYearNoOverflow():Carbon
Sub one year to the instance (using date interval) with overflow explicitly forbidden.
public addMonths(int $value = 1):Carbon
Add months (the $value count passed in) to the instance (using date interval).
int | $value = 1 |
public addMonth():Carbon
Add one month to the instance (using date interval).
public subMonths(int $value = 1):Carbon
Sub months (the $value count passed in) to the instance (using date interval).
int | $value = 1 |
public subMonth():Carbon
Sub one month to the instance (using date interval).
public addMonthsWithOverflow(int $value = 1):Carbon
Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
int | $value = 1 |
public addMonthWithOverflow():Carbon
Add one month to the instance (using date interval) with overflow explicitly allowed.
public subMonthsWithOverflow(int $value = 1):Carbon
Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
int | $value = 1 |
public subMonthWithOverflow():Carbon
Sub one month to the instance (using date interval) with overflow explicitly allowed.
public addMonthsNoOverflow(int $value = 1):Carbon
Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
int | $value = 1 |
public addMonthNoOverflow():Carbon
Add one month to the instance (using date interval) with overflow explicitly forbidden.
public subMonthsNoOverflow(int $value = 1):Carbon
Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
int | $value = 1 |
public subMonthNoOverflow():Carbon
Sub one month to the instance (using date interval) with overflow explicitly forbidden.
public addDays(int $value = 1):Carbon
Add days (the $value count passed in) to the instance (using date interval).
int | $value = 1 |
public addDay():Carbon
Add one day to the instance (using date interval).
public subDays(int $value = 1):Carbon
Sub days (the $value count passed in) to the instance (using date interval).
int | $value = 1 |
public subDay():Carbon
Sub one day to the instance (using date interval).
public addHours(int $value = 1):Carbon
Add hours (the $value count passed in) to the instance (using date interval).
int | $value = 1 |
public addHour():Carbon
Add one hour to the instance (using date interval).
public subHours(int $value = 1):Carbon
Sub hours (the $value count passed in) to the instance (using date interval).
int | $value = 1 |
public subHour():Carbon
Sub one hour to the instance (using date interval).
public addMinutes(int $value = 1):Carbon
Add minutes (the $value count passed in) to the instance (using date interval).
int | $value = 1 |
public addMinute():Carbon
Add one minute to the instance (using date interval).
public subMinutes(int $value = 1):Carbon
Sub minutes (the $value count passed in) to the instance (using date interval).
int | $value = 1 |
public subMinute():Carbon
Sub one minute to the instance (using date interval).
public addSeconds(int $value = 1):Carbon
Add seconds (the $value count passed in) to the instance (using date interval).
int | $value = 1 |
public addSecond():Carbon
Add one second to the instance (using date interval).
public subSeconds(int $value = 1):Carbon
Sub seconds (the $value count passed in) to the instance (using date interval).
int | $value = 1 |
public subSecond():Carbon
Sub one second to the instance (using date interval).
public addCenturies(int $value = 1):Carbon
Add centuries (the $value count passed in) to the instance (using date interval).
int | $value = 1 |
public addCentury():Carbon
Add one century to the instance (using date interval).
public subCenturies(int $value = 1):Carbon
Sub centuries (the $value count passed in) to the instance (using date interval).
int | $value = 1 |
public subCentury():Carbon
Sub one century to the instance (using date interval).
public addQuarters(int $value = 1):Carbon
Add quarters (the $value count passed in) to the instance (using date interval).
int | $value = 1 |
public addQuarter():Carbon
Add one quarter to the instance (using date interval).
public subQuarters(int $value = 1):Carbon
Sub quarters (the $value count passed in) to the instance (using date interval).
int | $value = 1 |
public subQuarter():Carbon
Sub one quarter to the instance (using date interval).
public addWeeks(int $value = 1):Carbon
Add weeks (the $value count passed in) to the instance (using date interval).
int | $value = 1 |
public addWeek():Carbon
Add one week to the instance (using date interval).
public subWeeks(int $value = 1):Carbon
Sub weeks (the $value count passed in) to the instance (using date interval).
int | $value = 1 |
public subWeek():Carbon
Sub one week to the instance (using date interval).
public addWeekdays(int $value = 1):Carbon
Add weekdays (the $value count passed in) to the instance (using date interval).
int | $value = 1 |
public addWeekday():Carbon
Add one weekday to the instance (using date interval).
public subWeekdays(int $value = 1):Carbon
Sub weekdays (the $value count passed in) to the instance (using date interval).
int | $value = 1 |
public subWeekday():Carbon
Sub one weekday to the instance (using date interval).
public addRealSeconds(int $value = 1):Carbon
Add seconds (the $value count passed in) to the instance (using timestamp).
int | $value = 1 |
public addRealSecond():Carbon
Add one second to the instance (using timestamp).
public subRealSeconds(int $value = 1):Carbon
Sub seconds (the $value count passed in) to the instance (using timestamp).
int | $value = 1 |
public subRealSecond():Carbon
Sub one second to the instance (using timestamp).
public addRealMinutes(int $value = 1):Carbon
Add minutes (the $value count passed in) to the instance (using timestamp).
int | $value = 1 |
public addRealMinute():Carbon
Add one minute to the instance (using timestamp).
public subRealMinutes(int $value = 1):Carbon
Sub minutes (the $value count passed in) to the instance (using timestamp).
int | $value = 1 |
public subRealMinute():Carbon
Sub one minute to the instance (using timestamp).
public addRealHours(int $value = 1):Carbon
Add hours (the $value count passed in) to the instance (using timestamp).
int | $value = 1 |
public addRealHour():Carbon
Add one hour to the instance (using timestamp).
public subRealHours(int $value = 1):Carbon
Sub hours (the $value count passed in) to the instance (using timestamp).
int | $value = 1 |
public subRealHour():Carbon
Sub one hour to the instance (using timestamp).
Abstract Model class
Illuminate\Database\Eloquent
Illuminate\Database\Eloquent
Symfony\Component\HttpFoundation