Order
extends Model
in package
Uses
Validation, SoftDelete
Thiocyn\Logistics\Models\Order
Tags
Table of Contents
- FulfilmentStatusCanceled = 'canceled'
- FulfilmentStatusOpen = 'open'
- FulfilmentStatusPrepare = 'prepare'
- FulfilmentStatusPrepared = 'prepared'
- FulfilmentStatusShipped = 'shipped'
- StatusOpen = 1
- StatusPreparing = 0
- StatusReturned = 50
- StatusStopped = 1000
- $belongsTo : mixed
- $carrier : string|null
- $channel : string
- $created_at : Carbon|null
- $creation_date : string
- $customer_id : int
- $deleted_at : Carbon|null
- $export_date_time : string|null
- $external_id : string|null
- $fulfillment_status : string
- $hasMany : mixed
- $id : int
- $import_date : string|null
- $json : string|null
- $logistic_number : string|null
- $logistic_partner : string
- $morphMany : mixed
- $name : mixed
- $notes : string|null
- $number : string
- $packaging_date_time : string|null
- $po_number : string|null
- $rules : array<string|int, mixed>
- $s_address1 : string|null
- $s_address2 : string|null
- $s_address3 : string|null
- $s_city : string
- $s_company : string|null
- $s_country : string
- $s_coutry_iso : string
- $s_first_name : string|null
- $s_last_name : string|null
- $s_zip : string
- $shipping_date_time : string|null
- $status : int
- $sync_left_flag : int
- $sync_right_flag : int
- $table : string
- $type : string
- $updated_at : Carbon|null
- $appends : mixed
- $dates : mixed
- $forceDeleting : bool
- Indicates if the model is currently force deleting.
- $hidden : mixed
- $jsonable : mixed
- $validationDefaultAttrNames : array<string|int, mixed>
- $validationErrors : MessageBag
- afterDelete() : mixed
- afterFetch() : mixed
- all() :
- beforeDelete() : mixed
- bootSoftDelete() : void
- Boot the soft deleting trait for a model.
- bootValidation() : void
- Boot the validation trait for this model.
- errors() : MessageBag
- Get validation error message collection for the Model
- forceDelete() : void
- Force a hard delete on a soft deleted model.
- forceSave() : bool
- Force save the model even if validation fails.
- get() :
- getCustomerIdOptions() : mixed
- getDeletedAtColumn() : string
- Get the name of the "deleted at" column.
- getNameAttribute() : mixed
- getQualifiedDeletedAtColumn() : string
- Get the fully qualified "deleted at" column.
- getStatusOptions() : mixed
- isAttributeRequired() : bool
- Determines if an attribute is required based on the validation rules.
- isSoftDelete() : bool
- Helper method to check if the model is currently being hard or soft deleted, useful in events.
- newModelQuery() :
- newQuery() :
- onlyTrashed() : Builder|static
- Get a new query builder that only includes soft deletes.
- query() :
- restore() : bool|null
- Restore a soft-deleted model instance.
- restored() : void
- Register a restored model event with the dispatcher.
- restoring() : void
- Register a restoring model event with the dispatcher.
- s_coutry_scholz() : mixed
- setValidationAttributeName() : void
- Programatically sets the validation attribute names, will take lower priority to model defined attribute names found in `$attributeNames`.
- setValidationAttributeNames() : void
- Programatically sets multiple validation attribute names.
- trashed() : bool
- Determine if the model instance has been soft-deleted.
- validate() : bool
- Validate the model instance
- validated() : void
- Create a new native event for handling afterValidate().
- validating() : void
- Create a new native event for handling beforeValidate().
- whereCarrier() :
- whereChannel() :
- whereCreatedAt() :
- whereCreationDate() :
- whereCustomerId() :
- whereDeletedAt() :
- whereExportDateTime() :
- whereExternalId() :
- whereFulfillmentStatus() :
- whereId() :
- whereImportDate() :
- whereJson() :
- whereLogisticNumber() :
- whereLogisticPartner() :
- whereNotes() :
- whereNumber() :
- wherePackagingDateTime() :
- wherePoNumber() :
- whereSAddress1() :
- whereSAddress2() :
- whereSAddress3() :
- whereSCity() :
- whereSCompany() :
- whereSCountry() :
- whereSCoutryIso() :
- whereSFirstName() :
- whereShippingDateTime() :
- whereSLastName() :
- whereStatus() :
- whereSyncLeftFlag() :
- whereSyncRightFlag() :
- whereSZip() :
- whereType() :
- whereUpdatedAt() :
- withTrashed() : Builder|static
- Get a new query builder that includes soft deletes.
- getRelationValidationValue() : mixed
- Attachments validate differently to their simple values.
- getValidationAttributes() : array<string|int, mixed>
- Returns the model data used for validation.
- makeValidator() : Validator
- Instantiates the validator used by the validation process, depending if the class is being used inside or outside of Laravel. Optional connection string to make the validator use a different database connection than the default connection.
- performDeleteOnModel() : mixed
- Perform the actual delete query on this model instance.
- performRestoreOnRelations() : void
- Locates relations with softDelete flag and cascades the restore event.
- performSoftDeleteOnRelations() : void
- Locates relations with softDelete flag and cascades the delete event.
- processRuleFieldNames() : array<string|int, mixed>
- Processes field names in a rule array.
- processValidationRules() : mixed
- Process rules
- processValidationUniqueRule() : string
- Rebuilds the unique validation rule to force for the existing ID
- runSoftDelete() : void
- Perform the actual delete query on this model instance.
Constants
FulfilmentStatusCanceled
public
mixed
FulfilmentStatusCanceled
= 'canceled'
FulfilmentStatusOpen
public
mixed
FulfilmentStatusOpen
= 'open'
FulfilmentStatusPrepare
public
mixed
FulfilmentStatusPrepare
= 'prepare'
FulfilmentStatusPrepared
public
mixed
FulfilmentStatusPrepared
= 'prepared'
FulfilmentStatusShipped
public
mixed
FulfilmentStatusShipped
= 'shipped'
StatusOpen
public
mixed
StatusOpen
= 1
StatusPreparing
public
mixed
StatusPreparing
= 0
StatusReturned
public
mixed
StatusReturned
= 50
StatusStopped
public
mixed
StatusStopped
= 1000
Properties
$belongsTo
public
mixed
$belongsTo
= ['customer' => 'Thiocyn\Logistics\Models\Customer', 'statusName' => ['Thiocyn\Logistics\Models\OrderStatus', 'key' => 'status', 'otherKey' => 'id']]
$carrier
public
string|null
$carrier
$channel
public
string
$channel
$created_at
public
Carbon|null
$created_at
$creation_date
public
string
$creation_date
$customer_id
public
int
$customer_id
$deleted_at
public
Carbon|null
$deleted_at
$export_date_time
public
string|null
$export_date_time
$external_id
public
string|null
$external_id
$fulfillment_status
public
string
$fulfillment_status
$hasMany
public
mixed
$hasMany
= ['returns' => ['Thiocyn\Logistics\Models\OReturn', 'delete' => true], 'lineitems' => [ThiocynLogisticsModelsOrderLineItem::class, 'delete' => true], 'trackingnumbers' => ['Thiocyn\Logistics\Models\OrderTrackingNumber', 'delete' => true]]
$id
public
int
$id
$import_date
public
string|null
$import_date
$json
public
string|null
$json
$logistic_number
public
string|null
$logistic_number
$logistic_partner
public
string
$logistic_partner
$morphMany
public
mixed
$morphMany
= ['history' => ['Thiocyn\Logistics\Models\History', 'name' => 'reference', 'delete' => true]]
$name read-only
public
mixed
$name
$notes
public
string|null
$notes
$number
public
string
$number
$packaging_date_time
public
string|null
$packaging_date_time
$po_number
public
string|null
$po_number
$rules
public
array<string|int, mixed>
$rules
= []
Validation rules
$s_address1
public
string|null
$s_address1
$s_address2
public
string|null
$s_address2
$s_address3
public
string|null
$s_address3
$s_city
public
string
$s_city
$s_company
public
string|null
$s_company
$s_country
public
string
$s_country
$s_coutry_iso
public
string
$s_coutry_iso
$s_first_name
public
string|null
$s_first_name
$s_last_name
public
string|null
$s_last_name
$s_zip
public
string
$s_zip
$shipping_date_time
public
string|null
$shipping_date_time
$status
public
int
$status
$sync_left_flag
public
int
$sync_left_flag
$sync_right_flag
public
int
$sync_right_flag
$table
public
string
$table
= 'thiocyn_logistics_order'
The database table used by the model.
$type
public
string
$type
$updated_at
public
Carbon|null
$updated_at
$appends
protected
mixed
$appends
= array('name')
$dates
protected
mixed
$dates
= ['deleted_at']
$forceDeleting
Indicates if the model is currently force deleting.
protected
bool
$forceDeleting
= false
$hidden
protected
mixed
$hidden
= ['history']
$jsonable
protected
mixed
$jsonable
= ['json']
$validationDefaultAttrNames
protected
array<string|int, mixed>
$validationDefaultAttrNames
= []
Default custom attribute names.
$validationErrors
protected
MessageBag
$validationErrors
The message bag instance containing validation error messages
Methods
afterDelete()
public
afterDelete() : mixed
Return values
mixed —afterFetch()
public
afterFetch() : mixed
Return values
mixed —all()
public
static all(mixed $columns) :
Parameters
- $columns : mixed
Return values
—beforeDelete()
public
beforeDelete() : mixed
Return values
mixed —bootSoftDelete()
Boot the soft deleting trait for a model.
public
static bootSoftDelete() : void
Return values
void —bootValidation()
Boot the validation trait for this model.
public
static bootValidation() : void
Return values
void —errors()
Get validation error message collection for the Model
public
errors() : MessageBag
Return values
MessageBag —forceDelete()
Force a hard delete on a soft deleted model.
public
forceDelete() : void
Return values
void —forceSave()
Force save the model even if validation fails.
public
forceSave([mixed $options = null ][, mixed $sessionKey = null ]) : bool
Parameters
- $options : mixed = null
- $sessionKey : mixed = null
Return values
bool —get()
public
static get(mixed $columns) :
Parameters
- $columns : mixed
Return values
—getCustomerIdOptions()
public
getCustomerIdOptions() : mixed
Return values
mixed —getDeletedAtColumn()
Get the name of the "deleted at" column.
public
getDeletedAtColumn() : string
Return values
string —getNameAttribute()
public
getNameAttribute() : mixed
Return values
mixed —getQualifiedDeletedAtColumn()
Get the fully qualified "deleted at" column.
public
getQualifiedDeletedAtColumn() : string
Return values
string —getStatusOptions()
public
getStatusOptions() : mixed
Return values
mixed —isAttributeRequired()
Determines if an attribute is required based on the validation rules.
public
isAttributeRequired(string $attribute[, bool $checkDependencies = true ]) : bool
Parameters
- $attribute : string
- $checkDependencies : bool = true
-
Checks the attribute dependencies (for required_if & required_with rules). Note that it will only be checked up to the next level, if another dependent rule is found then it will just assume the field is required
Return values
bool —isSoftDelete()
Helper method to check if the model is currently being hard or soft deleted, useful in events.
public
isSoftDelete() : bool
Return values
bool —newModelQuery()
public
static newModelQuery() :
Return values
—newQuery()
public
static newQuery() :
Return values
—onlyTrashed()
Get a new query builder that only includes soft deletes.
public
static onlyTrashed() : Builder|static
Return values
Builder|static —query()
public
static query() :
Return values
—restore()
Restore a soft-deleted model instance.
public
restore() : bool|null
Return values
bool|null —restored()
Register a restored model event with the dispatcher.
public
static restored(Closure|string $callback) : void
Parameters
- $callback : Closure|string
Return values
void —restoring()
Register a restoring model event with the dispatcher.
public
static restoring(Closure|string $callback) : void
Parameters
- $callback : Closure|string
Return values
void —s_coutry_scholz()
public
s_coutry_scholz() : mixed
Return values
mixed —setValidationAttributeName()
Programatically sets the validation attribute names, will take lower priority to model defined attribute names found in `$attributeNames`.
public
setValidationAttributeName(string $attr, string $name) : void
Parameters
- $attr : string
- $name : string
Return values
void —setValidationAttributeNames()
Programatically sets multiple validation attribute names.
public
setValidationAttributeNames(array<string|int, mixed> $attributeNames) : void
Parameters
- $attributeNames : array<string|int, mixed>
Return values
void —trashed()
Determine if the model instance has been soft-deleted.
public
trashed() : bool
Return values
bool —validate()
Validate the model instance
public
validate([mixed $rules = null ][, mixed $customMessages = null ][, mixed $attributeNames = null ]) : bool
Parameters
- $rules : mixed = null
- $customMessages : mixed = null
- $attributeNames : mixed = null
Return values
bool —validated()
Create a new native event for handling afterValidate().
public
static validated(Closure|string $callback) : void
Parameters
- $callback : Closure|string
Return values
void —validating()
Create a new native event for handling beforeValidate().
public
static validating(Closure|string $callback) : void
Parameters
- $callback : Closure|string
Return values
void —whereCarrier()
public
static whereCarrier(mixed $value) :
Parameters
- $value : mixed
Return values
—whereChannel()
public
static whereChannel(mixed $value) :
Parameters
- $value : mixed
Return values
—whereCreatedAt()
public
static whereCreatedAt(mixed $value) :
Parameters
- $value : mixed
Return values
—whereCreationDate()
public
static whereCreationDate(mixed $value) :
Parameters
- $value : mixed
Return values
—whereCustomerId()
public
static whereCustomerId(mixed $value) :
Parameters
- $value : mixed
Return values
—whereDeletedAt()
public
static whereDeletedAt(mixed $value) :
Parameters
- $value : mixed
Return values
—whereExportDateTime()
public
static whereExportDateTime(mixed $value) :
Parameters
- $value : mixed
Return values
—whereExternalId()
public
static whereExternalId(mixed $value) :
Parameters
- $value : mixed
Return values
—whereFulfillmentStatus()
public
static whereFulfillmentStatus(mixed $value) :
Parameters
- $value : mixed
Return values
—whereId()
public
static whereId(mixed $value) :
Parameters
- $value : mixed
Return values
—whereImportDate()
public
static whereImportDate(mixed $value) :
Parameters
- $value : mixed
Return values
—whereJson()
public
static whereJson(mixed $value) :
Parameters
- $value : mixed
Return values
—whereLogisticNumber()
public
static whereLogisticNumber(mixed $value) :
Parameters
- $value : mixed
Return values
—whereLogisticPartner()
public
static whereLogisticPartner(mixed $value) :
Parameters
- $value : mixed
Return values
—whereNotes()
public
static whereNotes(mixed $value) :
Parameters
- $value : mixed
Return values
—whereNumber()
public
static whereNumber(mixed $value) :
Parameters
- $value : mixed
Return values
—wherePackagingDateTime()
public
static wherePackagingDateTime(mixed $value) :
Parameters
- $value : mixed
Return values
—wherePoNumber()
public
static wherePoNumber(mixed $value) :
Parameters
- $value : mixed
Return values
—whereSAddress1()
public
static whereSAddress1(mixed $value) :
Parameters
- $value : mixed
Return values
—whereSAddress2()
public
static whereSAddress2(mixed $value) :
Parameters
- $value : mixed
Return values
—whereSAddress3()
public
static whereSAddress3(mixed $value) :
Parameters
- $value : mixed
Return values
—whereSCity()
public
static whereSCity(mixed $value) :
Parameters
- $value : mixed
Return values
—whereSCompany()
public
static whereSCompany(mixed $value) :
Parameters
- $value : mixed
Return values
—whereSCountry()
public
static whereSCountry(mixed $value) :
Parameters
- $value : mixed
Return values
—whereSCoutryIso()
public
static whereSCoutryIso(mixed $value) :
Parameters
- $value : mixed
Return values
—whereSFirstName()
public
static whereSFirstName(mixed $value) :
Parameters
- $value : mixed
Return values
—whereShippingDateTime()
public
static whereShippingDateTime(mixed $value) :
Parameters
- $value : mixed
Return values
—whereSLastName()
public
static whereSLastName(mixed $value) :
Parameters
- $value : mixed
Return values
—whereStatus()
public
static whereStatus(mixed $value) :
Parameters
- $value : mixed
Return values
—whereSyncLeftFlag()
public
static whereSyncLeftFlag(mixed $value) :
Parameters
- $value : mixed
Return values
—whereSyncRightFlag()
public
static whereSyncRightFlag(mixed $value) :
Parameters
- $value : mixed
Return values
—whereSZip()
public
static whereSZip(mixed $value) :
Parameters
- $value : mixed
Return values
—whereType()
public
static whereType(mixed $value) :
Parameters
- $value : mixed
Return values
—whereUpdatedAt()
public
static whereUpdatedAt(mixed $value) :
Parameters
- $value : mixed
Return values
—withTrashed()
Get a new query builder that includes soft deletes.
public
static withTrashed() : Builder|static
Return values
Builder|static —getRelationValidationValue()
Attachments validate differently to their simple values.
protected
getRelationValidationValue(mixed $relationName) : mixed
Parameters
- $relationName : mixed
Return values
mixed —getValidationAttributes()
Returns the model data used for validation.
protected
getValidationAttributes() : array<string|int, mixed>
Return values
array<string|int, mixed> —makeValidator()
Instantiates the validator used by the validation process, depending if the class is being used inside or outside of Laravel. Optional connection string to make the validator use a different database connection than the default connection.
protected
static makeValidator(mixed $data, mixed $rules, mixed $customMessages, mixed $attributeNames[, mixed $connection = null ]) : Validator
Parameters
- $data : mixed
- $rules : mixed
- $customMessages : mixed
- $attributeNames : mixed
- $connection : mixed = null
Return values
Validator —performDeleteOnModel()
Perform the actual delete query on this model instance.
protected
performDeleteOnModel() : mixed
Return values
mixed —performRestoreOnRelations()
Locates relations with softDelete flag and cascades the restore event.
protected
performRestoreOnRelations() : void
Return values
void —performSoftDeleteOnRelations()
Locates relations with softDelete flag and cascades the delete event.
protected
performSoftDeleteOnRelations() : void
Return values
void —processRuleFieldNames()
Processes field names in a rule array.
protected
processRuleFieldNames(array<string|int, mixed> $rules) : array<string|int, mixed>
Converts any field names using array notation (ie. field[child]) into dot notation (ie. field.child)
Parameters
- $rules : array<string|int, mixed>
-
Rules array
Return values
array<string|int, mixed> —processValidationRules()
Process rules
protected
processValidationRules(mixed $rules) : mixed
Parameters
- $rules : mixed
Return values
mixed —processValidationUniqueRule()
Rebuilds the unique validation rule to force for the existing ID
protected
processValidationUniqueRule(string $definition, string $fieldName) : string
Parameters
- $definition : string
- $fieldName : string
Return values
string —runSoftDelete()
Perform the actual delete query on this model instance.
protected
runSoftDelete() : void