Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
1 / 1 |
| CustomerAnswer | |
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
3 | |
100.00% |
1 / 1 |
| getUpdatedAtColumn | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| customer | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| answer | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Models; |
| 4 | |
| 5 | use Illuminate\Database\Eloquent\Relations\Pivot; |
| 6 | |
| 7 | /** |
| 8 | * @property integer $answer_id Foreign key Answer. |
| 9 | * @property integer $customer_id Foreign key Customer. |
| 10 | * @property-read \Illuminate\Support\Carbon $created_at Created date. |
| 11 | * |
| 12 | * @property-read \App\Models\Customer $customer Customer BelongsTo relation. |
| 13 | * @property-read \App\Models\Answer $answer Answer BelongsTo relation. |
| 14 | */ |
| 15 | class CustomerAnswer extends Pivot |
| 16 | { |
| 17 | /** |
| 18 | * Inhibit update_at column as we only have |
| 19 | * created_at. |
| 20 | * |
| 21 | * @return null |
| 22 | */ |
| 23 | public function getUpdatedAtColumn() |
| 24 | { |
| 25 | return null; |
| 26 | } |
| 27 | |
| 28 | // * RELATIONS |
| 29 | |
| 30 | /** |
| 31 | * Customer belongsTo relation. |
| 32 | * |
| 33 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
| 34 | */ |
| 35 | public function customer(): \Illuminate\Database\Eloquent\Relations\BelongsTo |
| 36 | { |
| 37 | return $this->belongsTo(Customer::class); |
| 38 | } |
| 39 | |
| 40 | /** |
| 41 | * Customer belongsTo relation. |
| 42 | * |
| 43 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
| 44 | */ |
| 45 | public function answer(): \Illuminate\Database\Eloquent\Relations\BelongsTo |
| 46 | { |
| 47 | return $this->belongsTo(Answer::class); |
| 48 | } |
| 49 | } |