Files
star-cloud/app/Models/System/Company.php
sky121113 fdd3589d7b
All checks were successful
star-cloud-deploy-demo / deploy-demo (push) Successful in 1m9s
feat(Admin/Company): 擴充業務類型與合約期間功能,補齊多語系翻譯詞條
2026-03-30 09:08:02 +08:00

55 lines
1.1 KiB
PHP

<?php
namespace App\Models\System;
use App\Models\Machine\Machine;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes;
use Spatie\Permission\Models\Role;
class Company extends Model
{
use HasFactory, SoftDeletes;
protected $fillable = [
'name',
'code',
'original_type',
'current_type',
'tax_id',
'contact_name',
'contact_phone',
'contact_email',
'status',
'start_date',
'end_date',
'note',
'settings',
];
protected $casts = [
'start_date' => 'date',
'end_date' => 'date',
'status' => 'integer',
'settings' => 'array',
];
/**
* Get the users for the company.
*/
public function users(): HasMany
{
return $this->hasMany(User::class);
}
/**
* Get the machines for the company.
*/
public function machines(): HasMany
{
return $this->hasMany(Machine::class);
}
}