19 lines
501 B
PHP
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);
|
|
}
|
|
}
|