1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00
invoiceninja/app/Models/Client.php
David Bomba 1ad857bac9
Vue JS Scaffolding (#2493)
* 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
2018-11-07 16:22:36 +11:00

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);
}
}