'string', 'currency_id' => 'string', 'is_deleted' => 'boolean', 'updated_at' => 'timestamp', 'created_at' => 'timestamp', 'deleted_at' => 'timestamp', ]; protected $touches = []; protected $with = [ // 'contacts', ]; protected $presenter = VendorPresenter::class; public function getEntityType() { return self::class; } public function primary_contact() { return $this->hasMany(VendorContact::class)->where('is_primary', true); } public function documents() { return $this->morphMany(Document::class, 'documentable'); } public function assigned_user() { return $this->belongsTo(User::class, 'assigned_user_id', 'id')->withTrashed(); } public function contacts() { return $this->hasMany(VendorContact::class)->orderBy('is_primary', 'desc'); } public function activities() { return $this->hasMany(Activity::class); } public function company() { return $this->belongsTo(Company::class); } public function user() { return $this->belongsTo(User::class)->withTrashed(); } }