32 lines
601 B
PHP
32 lines
601 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Models;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||
|
|
|
||
|
|
class Subscription extends Model
|
||
|
|
{
|
||
|
|
use SoftDeletes;
|
||
|
|
|
||
|
|
protected $fillable = [
|
||
|
|
'tenant_id', 'plan_id', 'started_at', 'ended_at', 'status',
|
||
|
|
];
|
||
|
|
|
||
|
|
protected $dates = [
|
||
|
|
'started_at', 'ended_at',
|
||
|
|
];
|
||
|
|
|
||
|
|
public function tenant() {
|
||
|
|
return $this->belongsTo(Tenant::class);
|
||
|
|
}
|
||
|
|
|
||
|
|
public function plan() {
|
||
|
|
return $this->belongsTo(Plan::class);
|
||
|
|
}
|
||
|
|
|
||
|
|
public function payments() {
|
||
|
|
return $this->hasMany(Payment::class);
|
||
|
|
}
|
||
|
|
}
|