2018-10-12 22:29:34 +11:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
2018-10-22 23:04:37 +11:00
|
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
|
use Laracasts\Presenter\PresentableTrait;
|
2018-10-12 22:29:34 +11:00
|
|
|
|
|
|
|
|
class Account extends Model
|
|
|
|
|
{
|
2018-10-22 23:04:37 +11:00
|
|
|
use SoftDeletes;
|
|
|
|
|
use PresentableTrait;
|
2018-10-15 23:40:34 +11:00
|
|
|
|
|
|
|
|
/**
|
2018-10-22 23:04:37 +11:00
|
|
|
* @var string
|
2018-10-15 23:40:34 +11:00
|
|
|
*/
|
2018-10-22 23:04:37 +11:00
|
|
|
protected $presenter = 'App\Models\Presenters\AccountPresenter';
|
2018-10-15 23:40:34 +11:00
|
|
|
|
|
|
|
|
/**
|
2018-10-22 23:04:37 +11:00
|
|
|
* @var array
|
2018-10-15 23:40:34 +11:00
|
|
|
*/
|
2018-10-22 23:04:37 +11:00
|
|
|
protected $fillable = [
|
|
|
|
|
'plan',
|
|
|
|
|
'plan_term',
|
|
|
|
|
'plan_price',
|
|
|
|
|
'plan_paid',
|
|
|
|
|
'plan_started',
|
|
|
|
|
'plan_expires',
|
|
|
|
|
];
|
2018-10-15 23:40:34 +11:00
|
|
|
|
|
|
|
|
/**
|
2018-10-22 23:04:37 +11:00
|
|
|
* @var array
|
2018-10-15 23:40:34 +11:00
|
|
|
*/
|
2018-10-22 23:04:37 +11:00
|
|
|
protected $dates = [
|
|
|
|
|
'deleted_at',
|
|
|
|
|
'promo_expires',
|
|
|
|
|
'discount_expires',
|
|
|
|
|
];
|
2018-10-15 23:40:34 +11:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
|
|
|
|
*/
|
2018-10-22 23:04:37 +11:00
|
|
|
public function companies()
|
2018-10-15 23:40:34 +11:00
|
|
|
{
|
2018-10-22 23:04:37 +11:00
|
|
|
return $this->hasMany(Company::class);
|
2018-10-15 23:40:34 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
|
|
|
*/
|
2018-10-22 23:04:37 +11:00
|
|
|
public function payment()
|
2018-10-15 23:40:34 +11:00
|
|
|
{
|
2018-10-22 23:04:37 +11:00
|
|
|
return $this->belongsTo(Payment::class);
|
2018-10-15 23:40:34 +11:00
|
|
|
}
|
2018-10-12 22:29:34 +11:00
|
|
|
}
|