25 lines
448 B
PHP
25 lines
448 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Product extends Model
|
|
{
|
|
use HasFactory;
|
|
use HasUUID;
|
|
public $primaryKey = "uuid";
|
|
|
|
public function images()
|
|
{
|
|
return $this->hasMany(Image::class, "product_uuid", "uuid");
|
|
}
|
|
|
|
protected $fillable = [
|
|
'name',
|
|
'description',
|
|
'images',
|
|
'price'
|
|
];
|
|
}
|