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-08 15:18:34 +01:00
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
2021-03-05 11:18:28 +01:00
|
|
|
|
|
|
|
class BillingSubscription extends BaseModel
|
|
|
|
{
|
2021-03-08 15:18:34 +01:00
|
|
|
use HasFactory, SoftDeletes;
|
|
|
|
|
|
|
|
protected $fillable = [
|
|
|
|
'user_id',
|
|
|
|
'product_id',
|
|
|
|
'company_id',
|
|
|
|
'product_id',
|
|
|
|
'is_recurring',
|
|
|
|
'frequency_id',
|
|
|
|
'auto_bill',
|
|
|
|
'promo_code',
|
|
|
|
'promo_discount',
|
|
|
|
'is_amount_discount',
|
|
|
|
'allow_cancellation',
|
|
|
|
'per_set_enabled',
|
|
|
|
'min_seats_limit',
|
|
|
|
'max_seats_limit',
|
|
|
|
'trial_enabled',
|
|
|
|
'trial_duration',
|
|
|
|
'allow_query_overrides',
|
|
|
|
'allow_plan_changes',
|
|
|
|
'plan_map',
|
|
|
|
'refund_period',
|
|
|
|
'webhook_configuration',
|
|
|
|
];
|
|
|
|
|
|
|
|
public function company(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
|
|
{
|
|
|
|
return $this->belongsTo(Company::class);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
|
|
{
|
|
|
|
return $this->belongsTo(User::class);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function product(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
|
|
{
|
|
|
|
return $this->belongsTo(Product::class);
|
|
|
|
}
|
2021-03-08 21:43:30 +01:00
|
|
|
|
2021-03-05 11:18:28 +01:00
|
|
|
}
|