ok

Mini Shell

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

<?php

namespace App\Observers;

use App\Models\ContractRenew;

class ContractRenewObserver
{

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

    public function creating(ContractRenew $contractRenew)
    {
        if (user()) {
            $contractRenew->added_by = user()->id;
        }

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

}

Zerion Mini Shell 1.0