DB物件存取問題 20250606
This commit is contained in:
parent
3307c062ab
commit
bb8cdcebe3
@ -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.");
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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.");
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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.");
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user