base commit
This commit is contained in:
17
app/Observers/EmployeeDocumentObserver.php
Normal file
17
app/Observers/EmployeeDocumentObserver.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Observers;
|
||||
|
||||
use App\Models\EmployeeDocument;
|
||||
|
||||
class EmployeeDocumentObserver
|
||||
{
|
||||
public function creating(EmployeeDocument $document): void
|
||||
{
|
||||
if ($document->uploaded_at === null) {
|
||||
$document->uploaded_at = now();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user