ldc-startcoq/app/Models/ProductComment.php
Jérémy Munsch 615263f233
Refactor and fixes
Fixes #33
Fixes #34
2023-09-08 16:02:21 +02:00

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);
}
}