Added settings for translation into other languages in the project.
This commit is contained in:
@@ -7,6 +7,7 @@ use App\Models\Scopes\SortScope;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Database\Eloquent\Attributes\ScopedBy;
|
||||
|
||||
@@ -70,4 +71,9 @@ final class ProjectLanguage extends Model
|
||||
},
|
||||
)->shouldCache();
|
||||
}
|
||||
|
||||
public function serviceTranslate(): HasOne
|
||||
{
|
||||
return $this->hasOne(ProjectTranslationService::class, 'language_id', 'id');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
final class ProjectTranslationService extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'project_translation_service';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'code',
|
||||
'language_id',
|
||||
'source_language_id',
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user