2021-08-10 12:09:49 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Relations\Pivot;
|
|
|
|
|
|
2023-09-06 17:24:53 +02:00
|
|
|
/**
|
|
|
|
|
* @property integer $answer_id Foreign key Answer.
|
|
|
|
|
* @property integer $customer_id Foreign key Customer.
|
|
|
|
|
* @property-read \Illuminate\Support\Carbon $created_at Created date.
|
|
|
|
|
*
|
|
|
|
|
* @property-read \App\Models\Customer $customer Customer BelongsTo relation.
|
|
|
|
|
* @property-read \App\Models\Answer $answer Answer BelongsTo relation.
|
|
|
|
|
*/
|
2021-08-10 12:09:49 +02:00
|
|
|
class CustomerAnswer extends Pivot
|
|
|
|
|
{
|
2021-12-19 15:57:24 +01:00
|
|
|
/**
|
|
|
|
|
* Inhibit update_at column as we only have
|
2023-09-06 17:24:53 +02:00
|
|
|
* created_at.
|
2021-12-19 15:57:24 +01:00
|
|
|
*
|
|
|
|
|
* @return null
|
|
|
|
|
*/
|
|
|
|
|
public function getUpdatedAtColumn()
|
|
|
|
|
{
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// * RELATIONS
|
|
|
|
|
|
|
|
|
|
/**
|
2023-09-06 17:24:53 +02:00
|
|
|
* Customer belongsTo relation.
|
2021-12-19 15:57:24 +01:00
|
|
|
*
|
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
|
|
|
*/
|
2023-09-06 17:24:53 +02:00
|
|
|
public function customer(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
2021-12-19 15:57:24 +01:00
|
|
|
{
|
|
|
|
|
return $this->belongsTo(Customer::class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2023-09-06 17:24:53 +02:00
|
|
|
* Customer belongsTo relation.
|
2021-12-19 15:57:24 +01:00
|
|
|
*
|
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
|
|
|
*/
|
2023-09-06 17:24:53 +02:00
|
|
|
public function answer(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
2021-12-19 15:57:24 +01:00
|
|
|
{
|
|
|
|
|
return $this->belongsTo(Answer::class);
|
|
|
|
|
}
|
2021-08-10 12:09:49 +02:00
|
|
|
}
|