<?php
namespace TPS\Birzha\Classes;

use TPS\Birzha\Models\Product as ProductItem;
use Illuminate\Support\Facades\Log;

class Product
{
    public static function getName($id)
    {
        $product = ProductItem::find($id);
        if($product){
            return $product->name;
        }
        
        return "";
    }

    public static function getImage($id)
    {
        Log::info("product id ".$id);
        $product = ProductItem::find($id);
        if($product){
            return $product->images[0]->path;
        }
        return null;
        
    }
}