mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
* Fixes for MakesHash trait * Client List DataTables * Data table dependencies * Confirmation URLs * Wire up firing events for notification emails
31 lines
553 B
PHP
31 lines
553 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Client extends Model
|
|
{
|
|
|
|
public function contacts()
|
|
{
|
|
return $this->hasMany(ClientContact::class);
|
|
}
|
|
|
|
public function locations()
|
|
{
|
|
return $this->hasMany(ClientLocation::class);
|
|
}
|
|
|
|
public function primary_location()
|
|
{
|
|
return $this->hasMany(ClientLocation::class)->whereIsPrimary(true);
|
|
}
|
|
|
|
public function primary_contact()
|
|
{
|
|
return $this->hasMany(ClientContact::class)->whereIsPrimary(true);
|
|
}
|
|
|
|
}
|