34 lines
618 B
PHP
34 lines
618 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
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'];
|
|
|
|
// * RELATIONSHIPS
|
|
|
|
/**
|
|
* Has many FaqQuestion relationship
|
|
*
|
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
|
*/
|
|
public function questions()
|
|
{
|
|
return $this->hasMany(FaqQuestion::class, 'theme_id');
|
|
}
|
|
}
|