2021-03-05 11:18:28 +01:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
|
|
|
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
|
|
|
*
|
|
|
|
* @license https://opensource.org/licenses/AAL
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
|
2021-03-10 01:08:58 +01:00
|
|
|
class ClientSubscription extends BaseModel
|
2021-03-05 11:18:28 +01:00
|
|
|
{
|
|
|
|
use HasFactory;
|
2021-03-10 01:08:58 +01:00
|
|
|
|
|
|
|
protected $fillable = [
|
|
|
|
// 'subscription_id',
|
|
|
|
// 'recurring_invoice_id',
|
|
|
|
// 'client_id',
|
|
|
|
// 'trial_started',
|
|
|
|
// 'trial_ends',
|
|
|
|
// 'is_deleted',
|
|
|
|
];
|
|
|
|
|
|
|
|
protected $casts = [
|
|
|
|
'is_deleted' => 'boolean',
|
|
|
|
'updated_at' => 'timestamp',
|
|
|
|
'created_at' => 'timestamp',
|
|
|
|
'deleted_at' => 'timestamp',
|
|
|
|
];
|
|
|
|
|
|
|
|
public function company(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
|
|
{
|
|
|
|
return $this->belongsTo(Company::class);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function recurring_invoice(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
|
|
{
|
|
|
|
return $this->belongsTo(RecurringInvoice::class);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function client(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
|
|
{
|
|
|
|
return $this->belongsTo(Client::class);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function subscription(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
|
|
{
|
|
|
|
return $this->belongsTo(BillingSubscription::class);
|
|
|
|
}
|
2021-03-05 11:18:28 +01:00
|
|
|
}
|