ok

Mini Shell

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

<?php

namespace App\Observers;

use App\Models\LeadCategory;

class LeadCategoryObserver
{

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

    public function creating(LeadCategory $leadCategory)
    {
        if (!isRunningInConsoleOrSeeding()) {
            $leadCategory->added_by = user()->id;
        }

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

}

Zerion Mini Shell 1.0