ldc-crm/app/Models/ModelAnswer.php
2025-08-05 15:30:34 +02:00

73 lines
1.5 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
/**
* @property integer $answer_id
* @property integer $model_id
* @property string $model_type
* @property-read \Illuminate\Support\Carbon $created_at
*
* @property \App\Models\Answer $answer
* @property \Illuminate\Database\Eloquent\Model $model
*/
class ModelAnswer extends Model
{
/**
* Define table name.
*
* @var string
*/
protected $table = 'model_answer';
/**
* The primary key for the model.
*
* @var string
*/
protected $primaryKey = null;
/**
* The attributes that are mass assignable.
*
* @var string[]
*/
protected $fillable = [
'answer_id',
'model_id',
'model_type',
];
/**
* Inhibit update_at column as we only have
* created_at.
*
* @return null
*/
public function getUpdatedAtColumn(): null
{
return null;
}
/**
* Customer belongsTo relation.
*
* @return \Illuminate\Database\Eloquent\Relations\MorphTo
*/
public function model(): \Illuminate\Database\Eloquent\Relations\MorphTo
{
return $this->morphTo();
}
/**
* Relation vers la réponse.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function answer(): \Illuminate\Database\Eloquent\Relations\BelongsTo
{
return $this->belongsTo(Answer::class);
}
}