\App\Http\ModelsInvoice

Summary

Methods
Properties
Constants
user()
invoice_items()
scopeByUser()
scopeGetID()
getCreatedAtAttribute()
scopeIdDescending()
scopeSales()
scopeInvoiceCount()
No public properties found
No constants found
No protected methods found
$fillable
N/A
No private methods found
No private properties found
N/A

Properties

$fillable

$fillable : 

Type

Methods

user()

user() : \Illuminate\Database\Eloquent\Relations\BelongsTo

An invoice (order) belongs to a user.

Returns

\Illuminate\Database\Eloquent\Relations\BelongsTo

invoice_items()

invoice_items() : \Illuminate\Database\Eloquent\Relations\HasMany

Each invoice has many invoice items (products purchased).

Returns

\Illuminate\Database\Eloquent\Relations\HasMany

scopeByUser()

scopeByUser(  $query,   $user_id) : mixed

Get all invoices by user TODO: switch to relationship.

Parameters

$query
$user_id

Returns

mixed

scopeGetID()

scopeGetID(  $query,   $slug) : mixed

Get invoice item by invoice_id.

Parameters

$query
$slug

Returns

mixed

getCreatedAtAttribute()

getCreatedAtAttribute(  $value) : mixed

Accessor to return invoice date in 'F d, Y' format.

Parameters

$value

Returns

mixed

scopeIdDescending()

scopeIdDescending(  $query) : mixed

Show the new invoices first.

Parameters

$query

Returns

mixed

scopeSales()

scopeSales(  $query,   $time) : mixed

Fetch sum of sub_total (sales) during a selected a period of time.

Parameters

$query
$time

Returns

mixed

scopeInvoiceCount()

scopeInvoiceCount(  $query,   $time) : mixed

Select the number of invoices created after a specific time.

Parameters

$query
$time

Returns

mixed