lname.', '.$this->fname.' '.$this->mname; } public function getVatableAttribute(): bool { return $this->type->type == 'Vatable'; } /** * Get all the branches for the Client */ public function branches(): HasMany { return $this->hasMany(Branch::class); } /** * Get the type associated with the Client */ public function type(): BelongsTo { return $this->belongsTo(ClientType::class); } public function accounts(): HasMany { return $this->hasMany(Account::class); } /** * The users that belong to the Client */ public function users(): BelongsToMany { return $this->belongsToMany(User::class); } public function transmittals(): HasMany { return $this->hasMany(Transmittal::class); } public function sales(): HasManyThrough { return $this->hasManyThrough(Sale::class, Branch::class); } public function expenses(): HasManyThrough { return $this->hasManyThrough(Expense::class, Branch::class); } public function journals(): HasManyThrough { return $this->hasManyThrough(Journal::class, Branch::class); } public function discounts(): HasMany { return $this->hasMany(Discount::class); } }