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

RonasIT / laravel-helpers / 12489544920

25 Dec 2024 04:53AM UTC coverage: 78.401% (+0.02%) from 78.385%
12489544920

Pull #168

github

web-flow
Merge a36445178 into 338a94856
Pull Request #168: #140 global export mode not affect for email testing

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

1020 of 1301 relevant lines covered (78.4%)

11.92 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

© 2025 Coveralls, Inc