Order
class Order extends BaseModel (View source)
Traits
Properties
protected array | $additionalSearchFields | Define the additional fields we want to index. |
from Searchable |
protected array | $additionalFilterableFields | Define the additional filterable fields. |
from Searchable |
protected array | $additionalSortableFields | Define the additional sortable fields. |
from Searchable |
protected array | $filterable | Define our base filterable attributes. |
|
protected array | $sortable | Define our base sortable attributes. |
|
protected | $casts | {@inheritDoc} | |
protected | $guarded | {@inheritDoc} | |
int | $id | ||
?int | $customer_id | ||
?int | $user_id | ||
int | $channel_id | ||
bool | $new_customer | ||
string | $status | ||
?string | $reference | ||
?string | $customer_reference | ||
int | $sub_total | ||
int | $discount_total | ||
array | $discount_breakdown | ||
array | $shipping_breakdown | ||
array | $tax_breakdown | ||
int | $tax_total | ||
int | $total | ||
?string | $notes | ||
string | $currency | ||
?string | $compare_currency_code | ||
float | $exchange_rate | ||
Carbon | $placed_at | ||
?array | $meta | ||
Carbon | $created_at | ||
Carbon | $updated_at |
Methods
Get new instance of the registered model.
Handle dynamic and static method calls into the model.
Forward a method call to the model only when calling a method on the model.
Register a model event with the dispatcher.
Fire the given event for the model.
Remove all the event listeners for the model.
{@inheritDoc}
Add an attribute into the additional searchable fields.
Handle dynamic static method calls into the model.
Return a new factory instance for the model.
Get the name of the index associated with the model.
Getter for status label.
Return the channel relationship.
Return the cart relationship.
Return the lines relationship.
Return physical product lines relationship.
Return digital product lines relationship.
Return shipping lines relationship.
Return product lines relationship.
Return the currency relationship.
Return the addresses relationship.
Return the shipping address relationship.
Return the billing address relationship.
Return the transactions relationship.
Return the charges relationship.
Return the charges relationship.
Return the refunds relationship.
Return the customer relationship.
Return the user relationship.
Determines if this is a draft order.
Determines if this is a placed order.
Details
Model
newInstance(array $attributes = [], bool $exists = false)
Get new instance of the registered model.
mixed
__call(string $method, array $parameters)
Handle dynamic and static method calls into the model.
Model
swap(string $newModelClass)
Swap the model implementation.
string
getMorphClass()
Get the class name of the base model.
protected bool
forwardCallsWhen(string $method, Model $model)
Forward a method call to the model only when calling a method on the model.
static protected void
registerModelEvent(string $event, QueuedClosure|Closure|string $callback)
Register a model event with the dispatcher.
protected mixed
fireModelEvent(string $event, bool $halt = true)
Fire the given event for the model.
static void
flushEventListeners()
Remove all the event listeners for the model.
__construct(array $attributes = [])
Create a new instance of the Model.
protected
getSearchableAttributes()
{@inheritDoc}
array
getFilterableAttributes()
Return our base attributes we want filterable.
void
addFilterableAttributes(array $attributes)
Add additional fields to filter on.
void
addSortableAttributes(array $attributes)
Add additional sortable attributes.
array
getSortableAttributes()
Return our base attributes we want sortable.
getObservableEvents()
{@inheritDoc}
void
addSearchableAttribute(string $key, string|mixed $value)
Add an attribute into the additional searchable fields.
toSearchableArray()
{@inheritDoc}
searchableUsing()
{@inheritDoc}
Tag>
tags()
Get the tags
syncTags(Collection $tags)
No description
LogOptions
getActivitylogOptions()
Get the log options for the activity log.
static mixed
__callStatic(string $method, array $parameters)
Handle dynamic static method calls into the model.
static protected OrderFactory
newFactory()
Return a new factory instance for the model.
string
searchableAs()
Get the name of the index associated with the model.
string
getStatusLabelAttribute()
Getter for status label.
void
channel()
Return the channel relationship.
BelongsTo
cart()
Return the cart relationship.
HasMany
lines()
Return the lines relationship.
HasMany
physicalLines()
Return physical product lines relationship.
HasMany
digitalLines()
Return digital product lines relationship.
HasMany
shippingLines()
Return shipping lines relationship.
HasMany
productLines()
Return product lines relationship.
BelongsTo
currency()
Return the currency relationship.
HasMany
addresses()
Return the addresses relationship.
HasOne
shippingAddress()
Return the shipping address relationship.
HasOne
billingAddress()
Return the billing address relationship.
HasMany
transactions()
Return the transactions relationship.
HasMany
captures()
Return the charges relationship.
HasMany
intents()
Return the charges relationship.
HasMany
refunds()
Return the refunds relationship.
BelongsTo
customer()
Return the customer relationship.
BelongsTo
user()
Return the user relationship.
bool
isDraft()
Determines if this is a draft order.
bool
isPlaced()
Determines if this is a placed order.