Files
sam-api/app/Models/Tenant.php
hskwon 609ac39ffb 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
2025-07-23 15:41:01 +09:00

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');
}
}