ok

Mini Shell

Direktori : /home2/selectio/www/fms-worksuite/app/Observers/
Upload File :
Current File : //home2/selectio/www/fms-worksuite/app/Observers/EmergencyContactObserver.php

<?php

namespace App\Observers;

use App\Helper\Files;
use App\Models\EmergencyContact;
use App\Models\EmployeeDocument;

class EmergencyContactObserver
{

    public function saving(EmergencyContact $emergencyContact)
    {
        if (!isRunningInConsoleOrSeeding()) {
            $emergencyContact->last_updated_by = user()->id;
        }
    }

    public function creating(EmergencyContact $emergencyContact)
    {
        if (!isRunningInConsoleOrSeeding()) {
            $emergencyContact->added_by = user()->id;

        }

        if (company()) {
            $emergencyContact->company_id = company()->id;
        }
    }

}

Zerion Mini Shell 1.0