<?php

namespace Modules\Payroll\Observers;

use Modules\Payroll\Entities\SalaryPaymentMethod;

class SalaryPaymentMethodObserver
{

    public function saving(SalaryPaymentMethod $salaryPaymentMethod)
    {
        // Cannot put in creating, because saving is fired before creating. And we need company id for check bellow
        if (company()) {
            $salaryPaymentMethod->company_id = company()->id;
        }
    }

}
