class LineItem extends Model implements Recyclable, Segregatable

Class LineItem

Traits

Properties

protected array $fillable

The attributes that are mass assignable.

Entity $entity
Transaction $transaction
Vat $vat
Account $account
int $quantity
float $amount
bool $vat_inclusive
Carbon $destroyed_at
Carbon $deleted_at

Methods

static void
bootSegregating()

Register EntityScope for Model.

BelongsTo
entity()

Model's Parent Entity.

static void
bootRecycling()

Model recycling events.

MorphMany
recycled()

Recycled Model records.

getTable()

Determine the model table name

__construct(array $attributes = [])

Construct new LineItem

string
toString($type = false)

Instance Identifier.

HasMany
ledgers()

LineItem Ledgers.

BelongsTo
transaction()

LineItem Transaction.

BelongsTo
account()

LineItem Account.

HasMany
appliedVats()

LineItem Applied VATs.

array
getVatAttribute()

Total Vat amount of the LineItem.

object
attributes()

LineItem attributes.

bool
addVat(Vat $vat)

Add Vat to LineItem Vats.

array
getVats()

Get LineItem Vats.

void
removeVat(Vat $vat)

Remove Vat from LineItem Vats.

bool
save(array $options = [])

Validate LineItem.

Details

in Segregating at line 28
static void bootSegregating()

Register EntityScope for Model.

Return Value

void

in Segregating at line 46
BelongsTo entity()

Model's Parent Entity.

Return Value

BelongsTo

in Recycling at line 28
static void bootRecycling()

Model recycling events.

Return Value

void

in Recycling at line 73
MorphMany recycled()

Recycled Model records.

Return Value

MorphMany

in ModelTablePrefix at line 22
getTable()

Determine the model table name

at line 116
__construct(array $attributes = [])

Construct new LineItem

Parameters

array $attributes

at line 132
string toString($type = false)

Instance Identifier.

Parameters

$type

Return Value

string

at line 144
HasMany ledgers()

LineItem Ledgers.

Return Value

HasMany

at line 154
BelongsTo transaction()

LineItem Transaction.

Return Value

BelongsTo

at line 164
BelongsTo account()

LineItem Account.

Return Value

BelongsTo

at line 174
HasMany appliedVats()

LineItem Applied VATs.

Return Value

HasMany

at line 184
array getVatAttribute()

Total Vat amount of the LineItem.

Return Value

array

at line 203
object attributes()

LineItem attributes.

Return Value

object

at line 213
bool addVat(Vat $vat)

Add Vat to LineItem Vats.

Parameters

Vat $vat

Return Value

bool

at line 245
array getVats()

Get LineItem Vats.

Return Value

array

at line 260
void removeVat(Vat $vat)

Remove Vat from LineItem Vats.

Parameters

Vat $vat

Return Value

void

at line 289
bool save(array $options = [])

Validate LineItem.

Parameters

array $options

Return Value

bool