LAR_Maintenance/app/Observers/MaintenanceHistoryObserver.php

19 lines
501 B
PHP
Raw Normal View History

2024-08-16 16:20:45 +00:00
<?php
namespace App\Observers;
use App\Models\MaintenanceHistory;
class MaintenanceHistoryObserver
{
public function creating(MaintenanceHistory $maintenanceHistory): void
{
$maintenanceHistory->hash = md5($maintenanceHistory->maintenance_id . $maintenanceHistory->start_at);
}
public function updating(MaintenanceHistory $maintenanceHistory): void
{
$maintenanceHistory->hash = md5($maintenanceHistory->maintenance_id . $maintenanceHistory->start_at);
}
}