mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 21:22:58 +01:00
1ad857bac9
* client ui * Paddin out client detail view * Padding out clients * Padding out clients * show maps * Padding out clients * fixes for migrations * client padding * Working on different Client UX * more client ux * New Client UI * Vue Scaffolding
40 lines
815 B
PHP
40 lines
815 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Laracasts\Presenter\PresentableTrait;
|
|
|
|
class Client extends BaseModel
|
|
{
|
|
use PresentableTrait;
|
|
|
|
protected $presenter = 'App\Models\Presenters\ClientPresenter';
|
|
|
|
|
|
public function contacts()
|
|
{
|
|
return $this->hasMany(ClientContact::class);
|
|
}
|
|
|
|
public function locations()
|
|
{
|
|
return $this->hasMany(ClientLocation::class);
|
|
}
|
|
|
|
public function primary_billing_location()
|
|
{
|
|
return $this->hasMany(ClientLocation::class)->whereIsPrimaryBilling(true);
|
|
}
|
|
|
|
public function primary_shipping_location()
|
|
{
|
|
return $this->hasMany(ClientLocation::class)->whereIsPrimaryShipping(true);
|
|
}
|
|
|
|
public function primary_contact()
|
|
{
|
|
return $this->hasMany(ClientContact::class)->whereIsPrimary(true);
|
|
}
|
|
|
|
}
|