<?php

namespace App\Http\Resources\Inventory;

use Illuminate\Http\Resources\Json\JsonResource;

class SupplierResource extends JsonResource
{
    public function toArray($request): array
    {
        return [
            'id' => (int) ($this['id'] ?? 0),
            'name' => (string) ($this['name'] ?? ''),
            'email' => $this['email'] ?? null,
            'phone' => $this['phone'] ?? null,
            'address' => $this['address'] ?? null,
            'notes' => $this['notes'] ?? null,
        ];
    }
}
