<?php

namespace App\Observers;

use App\Models\Provider;

class ProviderObserver
{
    public function creating(Provider $provider): void
    {
        if ($provider->profile_media_id !== null) {
            $provider->selfie_verified = false;
        }
    }

    public function updating(Provider $provider): void
    {
        if ($provider->isDirty('profile_media_id')) {
            $provider->selfie_verified = false;
        }
    }
}
