<?php

namespace App\Models;

use App\Models\Concerns\InteractsWithActivityLog;
use Illuminate\Database\Eloquent\Attributes\Guarded;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes;

#[Guarded(['id'])]
class Supplier extends Model
{
    // 1. Use Trait
    use HasFactory, InteractsWithActivityLog, SoftDeletes;

    // 2. Relation
    public function purchases(): HasMany
    {
        return $this->hasMany(Purchase::class);
    }
}
