feat : 테이블 및 DB 마이그레이션 파일 추가
products - common_codes - parts - products - files - price_histories - boms - bom_items boards - boards - board_settings - posts - board_comments - board_files - post_custom_field_values permissions - menus - roles - user_menu_permissions - role_menu_permissions tenants - tenants - plans - subscriptions - payments
This commit is contained in:
45
app/Models/Tenant.php
Normal file
45
app/Models/Tenant.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user