43 lines
1,003 B
PHP
43 lines
1,003 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* FaqTheme.
|
|
*
|
|
* @property string $question Question
|
|
* @property string $answer Answer
|
|
* @property-read \Illuminate\Support\Carbon $created_at Creation Date.
|
|
* @property-read \Illuminate\Support\Carbon $updated_at Last update Date.
|
|
*
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\FaqQuestion[] $questions
|
|
* Associated questions.
|
|
*/
|
|
class FaqTheme extends Model
|
|
{
|
|
/**
|
|
* The attributes that are mass assignable.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $fillable = ['name'];
|
|
|
|
/**
|
|
* The relations to eager load on every query.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $with = ['questions'];
|
|
|
|
/**
|
|
* Question relation
|
|
*
|
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
|
*/
|
|
public function questions()
|
|
{
|
|
return $this->hasMany(FaqQuestion::class, 'theme_id');
|
|
}
|
|
}
|