Issues (350)

app/Models/ContactRelationship.php (1 issue)

Severity
1
<?php
2
3
namespace App\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Spatie\Translatable\HasTranslations;
7
8
/**
9
 * @mixin IdeHelperContactRelationship
10
 */
11
class ContactRelationship extends Model
12
{
13
    use HasTranslations;
14
15
    public $timestamps = false;
16
17
    public array $translatable = ['name'];
18
19
    protected $appends = ['translated_name'];
20
21
    public function getTranslatedNameAttribute()
22
    {
23
        return $this->getTranslation('name', app()->getLocale());
0 ignored issues
show
The method getLocale() does not exist on Illuminate\Container\Container. Are you sure you never get this type here, but always one of the subclasses? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

23
        return $this->getTranslation('name', app()->/** @scrutinizer ignore-call */ getLocale());
Loading history...
24
    }
25
}
26