hasPermission($location)) throw new Exception("You do not have have permission to access this page."); $note = LocationNote::get($note_id); if(!$note || $note->location_id != $location->id) throw new Exception("Note not found."); $note->dts_deleted = DB::dts(); $note->commit(); Core::addAlert("success", "Note deleted successfully."); HTTP::redirect("/account/locations/$location->id");