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,11 +4,12 @@ namespace App\Models\Common;
use App\Abstracts\Model;
use App\Models\Document\Document;
use Bkwld\Cloner\Cloneable;
use App\Scopes\Contact as Scope;
use App\Traits\Contacts;
use App\Traits\Currencies;
use App\Traits\Media;
use App\Traits\Transactions;
use Bkwld\Cloner\Cloneable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Notifications\Notifiable;
@ -41,6 +42,18 @@ class Contact extends Model
*/
public $sortable = ['name', 'email', 'phone', 'enabled'];
/**
* The "booting" method of the model.
*
* @return void
*/
protected static function boot()
{
parent::boot();
static::addGlobalScope(new Scope);
}
public function documents()
{
return $this->hasMany('App\Models\Document\Document');