From fc3a5d0d0f68f617559274fa32ffe71ab260e537 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Thu, 24 Dec 2020 12:02:22 +0300 Subject: [PATCH] document total styling --- app/Models/Document/DocumentTotal.php | 40 +++++++++++++-------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/app/Models/Document/DocumentTotal.php b/app/Models/Document/DocumentTotal.php index 2498f3104..7304e83c2 100644 --- a/app/Models/Document/DocumentTotal.php +++ b/app/Models/Document/DocumentTotal.php @@ -32,6 +32,26 @@ class DocumentTotal extends Model return $this->belongsTo('App\Models\Document\Document'); } + public function scopeType(Builder $query, string $type) + { + return $query->where($this->table . '.type', '=', $type); + } + + public function scopeInvoice(Builder $query) + { + return $query->where($this->table . '.type', '=', Document::INVOICE_TYPE); + } + + public function scopeBill(Builder $query) + { + return $query->where($this->table . '.type', '=', Document::BILL_TYPE); + } + + public function scopeCode($query, $code) + { + return $query->where('code', '=', $code); + } + public function getTitleAttribute() { $title = $this->name; @@ -70,24 +90,4 @@ class DocumentTotal extends Model return $title; } - - public function scopeType(Builder $query, string $type) - { - return $query->where($this->table . '.type', '=', $type); - } - - public function scopeInvoice(Builder $query) - { - return $query->where($this->table . '.type', '=', Document::INVOICE_TYPE); - } - - public function scopeBill(Builder $query) - { - return $query->where($this->table . '.type', '=', Document::BILL_TYPE); - } - - public function scopeCode($query, $code) - { - return $query->where('code', '=', $code); - } }