class Order extends BaseModel (View source)

Traits

HasFactory
Searchable
LogsActivity
Macroable

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

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.

bool
forwardCallsWhen(string $method, Model $model)

Forward a method call to the model only when calling a method on the model.

static void
registerModelEvent(string $event, QueuedClosure|Closure|string $callback)

Register a model event with the dispatcher.

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.

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

from  HasTags
syncTags(Collection $tags)

No description

from  HasTags
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 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.

Details

Model newInstance(array $attributes = [], bool $exists = false)

Get new instance of the registered model.

Parameters

array $attributes
bool $exists

Return Value

Model

mixed __call(string $method, array $parameters)

Handle dynamic and static method calls into the model.

Parameters

string $method
array $parameters

Return Value

mixed

Model swap(string $newModelClass)

Swap the model implementation.

Parameters

string $newModelClass

Return Value

Model

string getMorphClass()

Get the class name of the base model.

Return Value

string

protected bool forwardCallsWhen(string $method, Model $model)

Forward a method call to the model only when calling a method on the model.

Parameters

string $method
Model $model

Return Value

bool

static protected void registerModelEvent(string $event, QueuedClosure|Closure|string $callback)

Register a model event with the dispatcher.

Parameters

string $event
QueuedClosure|Closure|string $callback

Return Value

void

protected mixed fireModelEvent(string $event, bool $halt = true)

Fire the given event for the model.

Parameters

string $event
bool $halt

Return Value

mixed

static void flushEventListeners()

Remove all the event listeners for the model.

Return Value

void

__construct(array $attributes = [])

Create a new instance of the Model.

Parameters

array $attributes

protected getSearchableAttributes()

{@inheritDoc}

array getFilterableAttributes()

Return our base attributes we want filterable.

Return Value

array

void addFilterableAttributes(array $attributes)

Add additional fields to filter on.

Parameters

array $attributes

Return Value

void

void addSortableAttributes(array $attributes)

Add additional sortable attributes.

Parameters

array $attributes

Return Value

void

array getSortableAttributes()

Return our base attributes we want sortable.

Return Value

array

getObservableEvents()

{@inheritDoc}

void addSearchableAttribute(string $key, string|mixed $value)

Add an attribute into the additional searchable fields.

Parameters

string $key
string|mixed $value

Return Value

void

toSearchableArray()

{@inheritDoc}

searchableUsing()

{@inheritDoc}

Tag> tags()

Get the tags

Return Value

Tag>

syncTags(Collection $tags)

No description

Parameters

Collection $tags

LogOptions getActivitylogOptions()

Get the log options for the activity log.

Return Value

LogOptions

static mixed __callStatic(string $method, array $parameters)

Handle dynamic static method calls into the model.

Parameters

string $method
array $parameters

Return Value

mixed

static protected OrderFactory newFactory()

Return a new factory instance for the model.

Return Value

OrderFactory

string searchableAs()

Get the name of the index associated with the model.

Return Value

string

string getStatusLabelAttribute()

Getter for status label.

Return Value

string

void channel()

Return the channel relationship.

Return Value

void

BelongsTo cart()

Return the cart relationship.

Return Value

BelongsTo

HasMany lines()

Return the lines relationship.

Return Value

HasMany

HasMany physicalLines()

Return physical product lines relationship.

Return Value

HasMany

HasMany digitalLines()

Return digital product lines relationship.

Return Value

HasMany

HasMany shippingLines()

Return shipping lines relationship.

Return Value

HasMany

HasMany productLines()

Return product lines relationship.

Return Value

HasMany

BelongsTo currency()

Return the currency relationship.

Return Value

BelongsTo

HasMany addresses()

Return the addresses relationship.

Return Value

HasMany

HasOne shippingAddress()

Return the shipping address relationship.

Return Value

HasOne

HasOne billingAddress()

Return the billing address relationship.

Return Value

HasOne

HasMany transactions()

Return the transactions relationship.

Return Value

HasMany

HasMany captures()

Return the charges relationship.

Return Value

HasMany

HasMany intents()

Return the charges relationship.

Return Value

HasMany

HasMany refunds()

Return the refunds relationship.

Return Value

HasMany

BelongsTo customer()

Return the customer relationship.

Return Value

BelongsTo

BelongsTo user()

Return the user relationship.

Return Value

BelongsTo

bool isDraft()

Determines if this is a draft order.

Return Value

bool

bool isPlaced()

Determines if this is a placed order.

Return Value

bool