public function ImageOrderUpdate (Request $request, $prop, $photo) {
//The photo to edit
$Photos_Edit = Images::where('property_id', $prop->id)->where('id', $photo)->firstorfail();
$OldPosition = $Photos_Edit->order; // Old position
$NewPosition = $request->photoorder; // New position
// Moving down where the fall between positions
if($NewPosition > $OldPosition) {
Images::where('order','<', $NewPosition)->where('order','>', $OldPosition)->decrement('order');
}
else {
Images::where('order','>', $NewPosition)->where('order','<', $OldPosition)->increment('order');
}
// Update the image sort position
$Photos_Edit->order = $NewPosition;
return back();