LAR_Maintenance/app/Observers/MaintenanceHistoryObserver.php
2024-08-16 18:20:45 +02:00

19 lines
501 B
PHP

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