40 lines
		
	
	
		
			949 B
		
	
	
	
		
			PHP
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
		
			949 B
		
	
	
	
		
			PHP
		
	
	
		
			Executable File
		
	
	
	
	
| <?php
 | ||
| 
 | ||
| namespace kernel\models;
 | ||
| 
 | ||
| use Illuminate\Database\Eloquent\Model;
 | ||
| 
 | ||
| class Option extends Model
 | ||
| {
 | ||
| 
 | ||
|     const DISABLE_STATUS = 0;
 | ||
|     const ACTIVE_STATUS = 1;
 | ||
| 
 | ||
|     protected $table = 'option';
 | ||
|     protected $fillable = ['key', 'value', 'label', 'status', 'created_at', 'updated_at'];
 | ||
|     protected array $dates = ['deleted_at'];
 | ||
| 
 | ||
|     public static function labels(): array
 | ||
|     {
 | ||
|         return [
 | ||
|             'key' => 'Ключ',
 | ||
|             'value' => 'Значение',
 | ||
|             'label' => 'Заголовок',
 | ||
|             'status' => 'Статус',
 | ||
|             'created_at' => 'Дата создания',
 | ||
|             'updated_at' => 'Дата редактирования',
 | ||
|         ];
 | ||
|     }
 | ||
| 
 | ||
|     /**
 | ||
|      * @return string[]
 | ||
|      */
 | ||
|     public static function getStatus(): array
 | ||
|     {
 | ||
|         return [
 | ||
|             self::DISABLE_STATUS => "Не активный",
 | ||
|             self::ACTIVE_STATUS => "Активный",
 | ||
|         ];
 | ||
|     }
 | ||
| 
 | ||
| } |