pai-sklep/app/Models/Product.php

24 lines
414 B
PHP
Raw Permalink Normal View History

2021-09-05 02:22:17 +02:00
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Product extends Model
{
2021-11-14 14:51:49 +01:00
use HasFactory;
use HasUUID;
2021-10-28 11:19:42 +02:00
public $primaryKey = "uuid";
2021-11-24 11:34:46 +01:00
public function images()
{
2021-11-14 20:44:10 +01:00
return $this->hasMany(Image::class, "product_uuid", "uuid");
}
2021-11-14 14:51:49 +01:00
2021-09-05 02:22:17 +02:00
protected $fillable = [
'name',
'description',
];
}