DB物件存取問題 20250606
This commit is contained in:
parent
3307c062ab
commit
bb8cdcebe3
@ -28,30 +28,5 @@ class MachineStatus extends Model
|
|||||||
'disk',
|
'disk',
|
||||||
'status',
|
'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() {
|
public function room() {
|
||||||
return $this->belongsTo(Room::class);
|
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',
|
'song_counts',
|
||||||
'updated_at',
|
'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