From bb8cdcebe38d5ff5d04d547d7d24d717eb7c4297 Mon Sep 17 00:00:00 2001 From: "allen.yan" Date: Fri, 6 Jun 2025 18:22:17 +0800 Subject: [PATCH] =?UTF-8?q?DB=E7=89=A9=E4=BB=B6=E5=AD=98=E5=8F=96=E5=95=8F?= =?UTF-8?q?=E9=A1=8C=2020250606?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/MachineStatus.php | 27 +-------------------------- app/Models/RoomStatusLog.php | 27 +-------------------------- app/Models/SongLibraryCache.php | 27 +-------------------------- 3 files changed, 3 insertions(+), 78 deletions(-) diff --git a/app/Models/MachineStatus.php b/app/Models/MachineStatus.php index f40e10d..fae0492 100644 --- a/app/Models/MachineStatus.php +++ b/app/Models/MachineStatus.php @@ -28,30 +28,5 @@ class MachineStatus extends Model 'disk', 'status', ]; - public function save(array $options = []) - { - throw new \Exception("MachineStatus is read-only."); - } - - public function delete() - { - throw new \Exception("MachineStatus cannot be deleted."); - } - - public static function create(array $attributes = []) - { - throw new \Exception("MachineStatus 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."); - }); - } + } diff --git a/app/Models/RoomStatusLog.php b/app/Models/RoomStatusLog.php index 8f1a910..1c7dca5 100644 --- a/app/Models/RoomStatusLog.php +++ b/app/Models/RoomStatusLog.php @@ -28,30 +28,5 @@ class RoomStatusLog extends Model public function room() { return $this->belongsTo(Room::class); } - public function save(array $options = []) - { - throw new \Exception("RoomStatusLog is read-only."); - } - - public function delete() - { - throw new \Exception("RoomStatusLog cannot be deleted."); - } - - public static function create(array $attributes = []) - { - throw new \Exception("RoomStatusLog 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."); - }); - } + } diff --git a/app/Models/SongLibraryCache.php b/app/Models/SongLibraryCache.php index 9fb6fcf..16ddd10 100644 --- a/app/Models/SongLibraryCache.php +++ b/app/Models/SongLibraryCache.php @@ -38,30 +38,5 @@ class SongLibraryCache extends Model '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."); - }); - } + }