22 lines
427 B
PHP
22 lines
427 B
PHP
<?php
|
|
namespace app\models;
|
|
|
|
use \Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* @method static where(string $string, $user_id)
|
|
*/
|
|
class Question extends Model {
|
|
protected $table = 'question';
|
|
protected $fillable = ['question','user_id'];
|
|
|
|
public function answers()
|
|
{
|
|
return $this->hasMany('\Models\Answer');
|
|
}
|
|
|
|
public function user()
|
|
{
|
|
return $this->belongsTo('\Models\User');
|
|
}
|
|
} |