Fixed order email, added site url tests, add doctrine/dbal, add service::site()

This commit is contained in:
Deon George
2020-02-09 23:12:34 +11:00
parent a92e94398c
commit cd18b98859
10 changed files with 316 additions and 28 deletions

View File

@@ -9,12 +9,12 @@ use App\Traits\NextKey;
class Payment extends Model
{
use NextKey;
const RECORD_ID = 'payment';
public $incrementing = FALSE;
const CREATED_AT = 'date_orig';
const UPDATED_AT = 'date_last';
const RECORD_ID = 'payment';
public $incrementing = FALSE;
protected $table = 'ab_payment';
protected $dates = ['date_payment'];
protected $dateFormat = 'U';

View File

@@ -11,15 +11,14 @@ use App\Traits\NextKey;
class Product extends Model
{
use NextKey;
const RECORD_ID = 'product';
public $incrementing = FALSE;
protected $table = 'ab_product';
protected $with = ['descriptions'];
const CREATED_AT = 'date_orig';
const UPDATED_AT = 'date_last';
public $incrementing = FALSE;
public $dateFormat = 'U';
public function descriptions()

View File

@@ -184,6 +184,17 @@ class Service extends Model
return $this->belongsTo(Product::class);
}
/**
* The site this service is configured for
*
* @todo It may be more appropriate to get this from the account->user attribute (ie: for mail actions)
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function site()
{
return $this->belongsTo(Site::class);
}
/**
* Return a child model with details of the service
*