ok

Mini Shell

Direktori : /home2/selectio/public_html/fms-worksuite/app/Observers/
Upload File :
Current File : /home2/selectio/public_html/fms-worksuite/app/Observers/EmployeeDocsObserver.php

<?php

namespace App\Observers;

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

class EmployeeDocsObserver
{

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

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

        }

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

}

Zerion Mini Shell 1.0