pai-sklep/app/Models/Product.php

23 lines
410 B
PHP
Raw 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-14 20:44:10 +01:00
public function images() {
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',
];
}