36 lines
604 B
PHP
Executable File
36 lines
604 B
PHP
Executable File
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Support\Facades\App;
|
|
|
|
/**
|
|
* @package App\Models
|
|
* @property int $id
|
|
* @property array $name
|
|
*
|
|
*/
|
|
class Measurement extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'name',
|
|
];
|
|
|
|
protected $casts = [
|
|
'name' => 'array',
|
|
];
|
|
|
|
public function getName(): string | null
|
|
{
|
|
if (App::isLocale('ru')) {
|
|
return (string) $this->name['ru'];
|
|
}
|
|
|
|
return (string) $this->name['uz'];
|
|
}
|
|
}
|