2018-10-12 13:29:34 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
2018-10-22 14:04:37 +02:00
|
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
use Laracasts\Presenter\PresentableTrait;
|
2018-10-12 13:29:34 +02:00
|
|
|
|
2018-11-02 11:54:46 +01:00
|
|
|
class Account extends BaseModel
|
2018-10-12 13:29:34 +02:00
|
|
|
{
|
2018-10-22 14:04:37 +02:00
|
|
|
use SoftDeletes;
|
|
|
|
use PresentableTrait;
|
2018-10-15 14:40:34 +02:00
|
|
|
|
|
|
|
/**
|
2018-10-22 14:04:37 +02:00
|
|
|
* @var string
|
2018-10-15 14:40:34 +02:00
|
|
|
*/
|
2018-10-22 14:04:37 +02:00
|
|
|
protected $presenter = 'App\Models\Presenters\AccountPresenter';
|
2018-10-15 14:40:34 +02:00
|
|
|
|
|
|
|
/**
|
2018-10-22 14:04:37 +02:00
|
|
|
* @var array
|
2018-10-15 14:40:34 +02:00
|
|
|
*/
|
2018-10-22 14:04:37 +02:00
|
|
|
protected $fillable = [
|
|
|
|
'plan',
|
|
|
|
'plan_term',
|
|
|
|
'plan_price',
|
|
|
|
'plan_paid',
|
|
|
|
'plan_started',
|
|
|
|
'plan_expires',
|
2018-10-24 05:50:15 +02:00
|
|
|
'utm_source',
|
|
|
|
'utm_medium',
|
|
|
|
'utm_campaign',
|
|
|
|
'utm_term',
|
|
|
|
'utm_content',
|
2018-10-22 14:04:37 +02:00
|
|
|
];
|
2018-10-15 14:40:34 +02:00
|
|
|
|
|
|
|
/**
|
2018-10-22 14:04:37 +02:00
|
|
|
* @var array
|
2018-10-15 14:40:34 +02:00
|
|
|
*/
|
2018-10-22 14:04:37 +02:00
|
|
|
protected $dates = [
|
|
|
|
'deleted_at',
|
|
|
|
'promo_expires',
|
|
|
|
'discount_expires',
|
|
|
|
];
|
2018-10-15 14:40:34 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
|
|
|
*/
|
|
|
|
|
2018-10-29 04:16:17 +01:00
|
|
|
public function default_company()
|
|
|
|
{
|
|
|
|
return $this->hasOne(Company::class, 'default_company_id', 'id');
|
|
|
|
}
|
2018-10-15 14:40:34 +02:00
|
|
|
/**
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
|
|
*/
|
2018-10-22 14:04:37 +02:00
|
|
|
public function payment()
|
2018-10-15 14:40:34 +02:00
|
|
|
{
|
2018-10-22 14:04:37 +02:00
|
|
|
return $this->belongsTo(Payment::class);
|
2018-10-15 14:40:34 +02:00
|
|
|
}
|
2018-10-12 13:29:34 +02:00
|
|
|
}
|