• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

RonasIT / laravel-helpers / 14753340340

30 Apr 2025 11:20AM UTC coverage: 77.669% (+0.08%) from 77.591%
14753340340

Pull #204

github

web-flow
Merge 8565e9e88 into 5a454cc9c
Pull Request #204: refactor: rmake valid nullable value for optional arguments in mock

6 of 6 new or added lines in 1 file covered. (100.0%)

1113 of 1433 relevant lines covered (77.67%)

12.54 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Traits/TranslationTrait.php
1
<?php
2

3
namespace RonasIT\Support\Traits;
4

5
trait TranslationTrait
6
{
7
    public function scopeWithTranslation($query)
8
    {
9
        if (class_exists($this->getTranslationClass())) {
×
10
            $query->with('translation');
×
11
        }
12
    }
13

14
    public function translation()
15
    {
16
        $lang = session('lang', 'en');
×
17
        $translationClass = $this->getTranslationClass();
×
18

19
        return $this->hasOne($translationClass)->where('locale', $lang);
×
20
    }
21

22
    public function allTranslations()
23
    {
24
        return $this->hasMany($this->getTranslationClass());
×
25
    }
26

27
    public function getTranslationClass(): string
28
    {
29
        return get_class($this) . 'Translation';
×
30
    }
31
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc