ldc-startcoq/app/Models/ProductComment.php

60 lines
1.2 KiB
PHP
Raw Normal View History

2023-02-22 11:51:36 +01:00
<?php
namespace App\Models;
2023-02-23 16:23:00 +01:00
use Illuminate\Database\Eloquent\Factories\HasFactory;
2023-02-22 11:51:36 +01:00
use Illuminate\Database\Eloquent\Model;
/**
2023-09-08 16:02:21 +02:00
* @property integer $id
* @property integer $product_id
* @property string $evaluation
* @property string|null $aspect
* @property string|null $taste
* @property string|null $odor
* @property string|null $texture
* @property \Carbon\Carbon $created_at
* @property \Carbon\Carbon $updated_at
*
* * RELATIONSHIPS
* @property-read \App\Models\Product $product
2023-02-22 11:51:36 +01:00
*/
class ProductComment extends Model
{
2023-02-23 16:23:00 +01:00
use HasFactory;
2023-02-22 11:51:36 +01:00
/**
* @var array
*/
protected $fillable = [
'product_id',
'evaluation',
'aspect',
'taste',
'odor',
'texture',
'created_at',
'updated_at'
];
2023-09-08 16:02:21 +02:00
/**
* The attributes that should be cast.
*
* @var array
*/
protected $casts = [
'created_at' => 'datetime',
'updated_at' => 'datetime',
];
// * RELATIONSHIPS
2023-02-22 11:51:36 +01:00
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function product()
{
2023-09-08 16:02:21 +02:00
return $this->belongsTo(Product::class);
2023-02-22 11:51:36 +01:00
}
}