Created API endpoints
This commit is contained in:
45
app/Models/Answer.php
Normal file
45
app/Models/Answer.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class Answer extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
/**
|
||||
* The attributes that should be mutated to dates.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $dates = [
|
||||
'updated_at',
|
||||
'created_at',
|
||||
'deleted_at'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'choice',
|
||||
'text',
|
||||
'respondent_id',
|
||||
'question_id',
|
||||
'questionchoice_id'
|
||||
];
|
||||
|
||||
public function question()
|
||||
{
|
||||
return $this->belongsTo(Question::class);
|
||||
}
|
||||
|
||||
public function questionchoice()
|
||||
{
|
||||
return $this->belongsTo(Questionchoice::class);
|
||||
}
|
||||
|
||||
public function respondent()
|
||||
{
|
||||
return $this->belongsTo(Respondent::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user