restore composer.json, add mysqli extension
This commit is contained in:
45
app/Models/PaymentSystemModel.php
Executable file
45
app/Models/PaymentSystemModel.php
Executable file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Support\Facades\App;
|
||||
|
||||
/**
|
||||
* @package App\Models
|
||||
* @property int $id
|
||||
* @property array $title
|
||||
* @property string $slug
|
||||
*
|
||||
* @property PaymentSystemItem[]|HasMany $items
|
||||
*
|
||||
* @method getTitle(): string
|
||||
*/
|
||||
class PaymentSystemModel extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = ['title', 'slug'];
|
||||
|
||||
protected $casts = [
|
||||
'title' => 'array',
|
||||
];
|
||||
|
||||
protected $table = 'payment_system_models';
|
||||
|
||||
public function items(): HasMany
|
||||
{
|
||||
return $this->hasMany(PaymentSystemItem::class, 'payment_system_id', 'id');
|
||||
}
|
||||
|
||||
public function getTitle(): string
|
||||
{
|
||||
if (App::isLocale('ru')) {
|
||||
return (string) $this->title['ru'];
|
||||
}
|
||||
|
||||
return (string) $this->title['uz'];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user