59 lines
1.2 KiB
PHP
59 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* @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
|
|
*/
|
|
class ProductComment extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
/**
|
|
* @var array
|
|
*/
|
|
protected $fillable = [
|
|
'product_id',
|
|
'evaluation',
|
|
'aspect',
|
|
'taste',
|
|
'odor',
|
|
'texture',
|
|
'created_at',
|
|
'updated_at'
|
|
];
|
|
|
|
/**
|
|
* The attributes that should be cast.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $casts = [
|
|
'created_at' => 'datetime',
|
|
'updated_at' => 'datetime',
|
|
];
|
|
|
|
// * RELATIONSHIPS
|
|
|
|
/**
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
*/
|
|
public function product()
|
|
{
|
|
return $this->belongsTo(Product::class);
|
|
}
|
|
}
|