File: D:/HostingSpaces/SBogers10/ste.komma.pro/app/QuestionCategories/QuestionCategoryService.php
<?php
namespace App\QuestionCategories;
use App\Base\Service;
use App\QuestionCategories\Models\QuestionCategory;
class QuestionCategoryService extends Service
{
private $QuestionCategory;
public function __construct()
{
parent::__construct();
// Set options first if needed
if(!isset($this->options)) $this->setQuestionCategories();
}
/**
* @return mixed
*/
public function getQuestionCategories()
{
return $this->QuestionCategory;
}
public function setQuestionCategories(): void
{
$this->QuestionCategory = QuestionCategory::where('active', 1)
->with('translation')
->has('translation')
->orderBy('lft')
->get();
}
}