File: D:/HostingSpaces/SBogers10/rentman.komma.pro/app/Komma/Questions/models/Question.php
<?php
namespace Komma\Questions\Models;
class Question extends \Komma\Kms\Questions\Models\Question
{
public $kmsClass = 'Komma\\Kms\\Questions\\Models\\Question';
/**
* With this relation we can collect a specific translation
* Based on the locale.
*
* @return mixed
*/
public function translation()
{
return $this->hasOne('Komma\Questions\Models\QuestionTranslation')
//We only need the translation
->select('question_translations.*')
//Join the languages
->join('languages', 'languages.id', '=', 'question_translations.language_id')
//Get only the language with the correct lang
->where('languages.iso_2', '=', \App::getLocale());
}
}