fixed common api endpoints

This commit is contained in:
Denis Duliçi
2020-12-26 16:13:34 +03:00
parent 8dbe178a70
commit 2e09989cf5
13 changed files with 267 additions and 113 deletions

View File

@ -4,6 +4,7 @@ namespace App\Models\Banking;
use App\Abstracts\Model;
use App\Models\Setting\Category;
use App\Scopes\Transaction as Scope;
use App\Traits\Currencies;
use App\Traits\DateTime;
use App\Traits\Media;
@ -52,6 +53,18 @@ class Transaction extends Model
*/
public $cloneable_relations = ['recurring'];
/**
* The "booting" method of the model.
*
* @return void
*/
protected static function boot()
{
parent::boot();
static::addGlobalScope(new Scope);
}
public function account()
{
return $this->belongsTo('App\Models\Banking\Account')->withDefault(['name' => trans('general.na')]);