user() : \Illuminate\Database\Eloquent\Relations\BelongsTo
An invoice (order) belongs to a user.
invoice_items() : \Illuminate\Database\Eloquent\Relations\HasMany
Each invoice has many invoice items (products purchased).
scopeByUser( $query, $user_id) : mixed
Get all invoices by user
TODO: switch to relationship.
scopeGetID( $query, $slug) : mixed
Get invoice item by invoice_id.
getCreatedAtAttribute( $value) : mixed
Accessor to return invoice date in 'F d, Y' format.
scopeIdDescending( $query) : mixed
Show the new invoices first.
scopeSales( $query, $time) : mixed
Fetch sum of sub_total (sales) during a selected a period of time.
scopeInvoiceCount( $query, $time) : mixed
Select the number of invoices created after a specific time.