Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
Answer
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 2
6
0.00% covered (danger)
0.00%
0 / 1
 question
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 customers
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace App\Models;
4
5use Illuminate\Database\Eloquent\Factories\HasFactory;
6use Illuminate\Database\Eloquent\Model;
7
8class Answer extends Model
9{
10    use HasFactory;
11
12    /**
13     * The attributes that are mass assignable.
14     *
15     * @var string[]
16     */
17    protected $fillable = [
18        'answer'
19    ];
20
21    // * RELATIONS
22
23    /**
24     * Question BelongsTo relation
25     *
26     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
27     */
28    public function question()
29    {
30        return $this->belongsTo(Question::class);
31    }
32
33    /**
34     * Answer belongsToMany relation
35     *
36     * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
37     */
38    public function customers()
39    {
40        return $this->belongsToMany(Customer::class, 'customer_answer');
41    }
42}