[FEAT] 實作維修管理模組與 RBAC 權限整合、多語系支援及 UI 優化
All checks were successful
star-cloud-deploy-demo / deploy-demo (push) Successful in 1m3s
All checks were successful
star-cloud-deploy-demo / deploy-demo (push) Successful in 1m3s
This commit is contained in:
45
app/Models/Machine/MaintenanceRecord.php
Normal file
45
app/Models/Machine/MaintenanceRecord.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Machine;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
use App\Traits\TenantScoped;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use App\Models\System\User;
|
||||
use App\Models\Machine\Machine;
|
||||
|
||||
class MaintenanceRecord extends Model
|
||||
{
|
||||
use TenantScoped, SoftDeletes;
|
||||
|
||||
protected $fillable = [
|
||||
'company_id',
|
||||
'machine_id',
|
||||
'user_id',
|
||||
'category',
|
||||
'content',
|
||||
'photos',
|
||||
'maintenance_at',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'photos' => 'array',
|
||||
'maintenance_at' => 'datetime',
|
||||
];
|
||||
|
||||
public function machine()
|
||||
{
|
||||
return $this->belongsTo(Machine::class);
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function company()
|
||||
{
|
||||
return $this->belongsTo(\App\Models\System\Company::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user