KTVCentral/app/Models/SongLibraryCache.php
allen.yan 3307c062ab 加入 包廂控制紀錄
加入 設備紀錄
加入 歌曲庫 cache 列表
調整 包廂控制邏輯
調整 心跳封包邏輯
調整 驗証包廂狀態邏輯
20250606
2025-06-06 18:11:22 +08:00

68 lines
1.6 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class SongLibraryCache extends Model
{
protected $table = 'song_library_cache';
protected $primaryKey = 'song_id';
public $incrementing = true;
protected $keyType = 'int';
const CREATED_AT = null;
const UPDATED_AT = 'updated_at';
// 可寫入的欄位(可依需要擴充)
protected $fillable = [
'song_name',
'song_simplified',
'phonetic_abbr',
'pinyin_abbr',
'strokes_abbr',
'song_number',
'artistA',
'artistB',
'artistA_simplified',
'artistB_simplified',
'artistA_category',
'artistB_category',
'artist_category',
'song_filename',
'song_category',
'language_name',
'add_date',
'situation',
'vocal',
'db_change',
'song_counts',
'updated_at',
];
public function save(array $options = [])
{
throw new \Exception("SongLibraryCache is read-only.");
}
public function delete()
{
throw new \Exception("SongLibraryCache cannot be deleted.");
}
public static function create(array $attributes = [])
{
throw new \Exception("SongLibraryCache is read-only.");
}
public static function booted()
{
// 防止 mass update/delete
static::updating(function () {
throw new \Exception("Updating is not allowed.");
});
static::deleting(function () {
throw new \Exception("Deleting is not allowed.");
});
}
}