restore composer.json, add mysqli extension
This commit is contained in:
40
app/Models/Power.php
Executable file
40
app/Models/Power.php
Executable file
@@ -0,0 +1,40 @@
|
||||
<?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
|
||||
* @property string $power
|
||||
* @property string $created_at
|
||||
* @property string $updated_at
|
||||
*
|
||||
* @property UsefulInfoItem[] $items
|
||||
*/
|
||||
class Power extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'power',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'name' => 'array',
|
||||
];
|
||||
|
||||
public function getName(): string
|
||||
{
|
||||
if (App::isLocale('ru')) {
|
||||
return (string) $this->name['ru'];
|
||||
}
|
||||
|
||||
return (string) $this->name['uz'];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user