46 lines
925 B
PHP
46 lines
925 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Models;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||
|
|
|
||
|
|
class Tenant extends Model
|
||
|
|
{
|
||
|
|
use SoftDeletes;
|
||
|
|
|
||
|
|
protected $fillable = [
|
||
|
|
'name',
|
||
|
|
'code',
|
||
|
|
'email',
|
||
|
|
'phone',
|
||
|
|
'address',
|
||
|
|
'tenant_st_code',
|
||
|
|
'plan_id',
|
||
|
|
'subscription_id',
|
||
|
|
'max_users',
|
||
|
|
'trial_ends_at',
|
||
|
|
'expires_at',
|
||
|
|
'last_paid_at',
|
||
|
|
'billing_tp_code',
|
||
|
|
];
|
||
|
|
|
||
|
|
protected $casts = [
|
||
|
|
'trial_ends_at' => 'datetime',
|
||
|
|
'expires_at' => 'datetime',
|
||
|
|
'last_paid_at' => 'datetime',
|
||
|
|
'max_users' => 'integer',
|
||
|
|
];
|
||
|
|
|
||
|
|
// 관계 정의 (예시)
|
||
|
|
public function plan()
|
||
|
|
{
|
||
|
|
return $this->belongsTo(Plan::class, 'plan_id');
|
||
|
|
}
|
||
|
|
|
||
|
|
public function subscription()
|
||
|
|
{
|
||
|
|
return $this->belongsTo(Subscription::class, 'subscription_id');
|
||
|
|
}
|
||
|
|
}
|