Other file added

This commit is contained in:
cuneytsenturk
2018-01-02 18:20:52 +03:00
parent dd686409ef
commit 675b1ba42a
11 changed files with 181 additions and 10 deletions

View File

@ -5,10 +5,11 @@ namespace App\Models\Expense;
use App\Models\Model;
use App\Traits\Currencies;
use App\Traits\DateTime;
use Plank\Mediable\Mediable;
class BillPayment extends Model
{
use Currencies, DateTime;
use Currencies, DateTime, Mediable;
protected $table = 'bill_payments';
@ -78,4 +79,18 @@ class BillPayment extends Model
{
return $query->sum('amount');
}
/**
* Get the current balance.
*
* @return string
*/
public function getAttachmentAttribute()
{
if (!$this->hasMedia('attachment')) {
return false;
}
return $this->getMedia('attachment')->last();
}
}