class CartLine extends BaseModel (View source)

Traits

HasFactory
LogsActivity
Macroable

Properties

array $cachableProperties

Array of cachable class properties.

$unitPrice

The cart line unit price.

$subTotal

The cart line sub total.

$subTotalDiscounted

The discounted sub total

$discountTotal

The discount total.

$taxAmount

The cart line tax amount.

$total

The cart line total.

$promotionDescription

The promotion description.

$taxBreakdown

All the tax breakdowns for the cart line.

protected array $guarded

Define which attributes should be protected from mass assignment.

protected array $casts

The attributes that should be cast.

int $id
int $cart_id
string $purchasable_type
int $purchasable_id
int $quantity
?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.

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 
bootCachesProperties()

No description

refresh()

No description

string
cachePropertiesPrefix()

Returns a unique key for the cache.

void
cacheProperties()

Cache properties for reuse in same request.

void
restoreProperties()

Restores properties from the same request.

static CartLineFactory
newFactory()

Return a new factory instance for the model.

BelongsTo
cart()

Return the cart relationship.

HasOneThrough
taxClass()

Return the tax class relationship.

discounts()

No description

MorphTo
purchasable()

Return the polymorphic relation.

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

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 bootCachesProperties()

No description

refresh()

No description

protected string cachePropertiesPrefix()

Returns a unique key for the cache.

Return Value

string

void cacheProperties()

Cache properties for reuse in same request.

Return Value

void

void restoreProperties()

Restores properties from the same request.

Return Value

void

static protected CartLineFactory newFactory()

Return a new factory instance for the model.

Return Value

CartLineFactory

BelongsTo cart()

Return the cart relationship.

Return Value

BelongsTo

HasOneThrough taxClass()

Return the tax class relationship.

Return Value

HasOneThrough

discounts()

No description

MorphTo purchasable()

Return the polymorphic relation.

Return Value

MorphTo