55 lines
1.4 KiB
PHP
55 lines
1.4 KiB
PHP
<?php
|
||
|
||
namespace app\modules\module_shop\models;
|
||
|
||
use Illuminate\Database\Eloquent\Model;
|
||
|
||
/**
|
||
* @property int $id
|
||
* @property string $name
|
||
* @property string $slug
|
||
* @property string $version
|
||
* @property string $description
|
||
* @property string $author
|
||
* @property int $status
|
||
* @property int $installations
|
||
* @property int $views
|
||
* @property string $path_to_archive
|
||
* @property string $dependence
|
||
*/
|
||
class ModuleShop extends Model
|
||
{
|
||
const DISABLE_STATUS = 0;
|
||
const ACTIVE_STATUS = 1;
|
||
|
||
protected $table = "module_shop";
|
||
|
||
protected $fillable = ['name', 'slug', 'version', 'description', 'author', 'status', 'dependence', 'installations', 'views'];
|
||
|
||
public static function labels(): array
|
||
{
|
||
return [
|
||
'name' => 'Название',
|
||
'version' => 'Версия',
|
||
'description' => 'Описание',
|
||
'author' => 'Автор',
|
||
'status' => 'Статус',
|
||
'slug' => 'Slug',
|
||
'dependence' => 'Зависимости',
|
||
'installations' => 'Установки',
|
||
'views' => 'Просмотры',
|
||
];
|
||
}
|
||
|
||
/**
|
||
* @return string[]
|
||
*/
|
||
public static function getStatus(): array
|
||
{
|
||
return [
|
||
self::DISABLE_STATUS => "Не активный",
|
||
self::ACTIVE_STATUS => "Активный",
|
||
];
|
||
}
|
||
|
||
} |