<?php

namespace App\Models;

use App\Services\Repositories\ProductRepository;
use Illuminate\Database\Eloquent\Model;

class Cart extends Model
{
    public $timestamps = false;

    protected $fillable = [
        'count',
        'user_id',
        'product_id',
    ];

    public function getProductAttribute()
    {
        $productRepository = app(ProductRepository::class);
        $product = $productRepository->checkItem($this->product_id);
        return $product;
    }


}
