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."); - }); - } + }